/www/cgi-bin/acbackupNetcore NBR200V2 firmware V1.3.241127.071246 contains a remote command injection vulnerability in the backup and restore CGI endpoint. The script URL-decodes attacker-controlled query-string data and feeds attacker-derived parameter names into eval. The decoder does not neutralize newline-based shell syntax, so a remote attacker can inject arbitrary shell commands through a crafted request. The vulnerability can be used to reboot the router, interrupt services, or obtain arbitrary code execution.
Vulnerability chain:
QUERY_STRING=`urldecode "$QUERY_STRING"`
printf:str=${str//[\"\'\`|\\<>@?*~!();,.\$\^]/}
str=${str//%/\\x}
str=`printf "$str"`
key is evaluated as shell syntax:while [ true ]; do
param=${QUERY_STRING%%&*}
QUERY_STRING=${QUERY_STRING#*&}
val=${param#*=}
key=${param%=*}
eval "${key}='${val}'"
...
done
eval "${key}='${val}'"
www/cgi-bin/upgrade, but it is a distinct endpoint and should be treated as a separate vulnerability.