/www/cgi-bin/network_toolsNetcore NBR200V2 firmware V1.3.241127.071246 contains a remote command injection vulnerability in the CGI diagnostic endpoint. The script parses attacker-controlled query-string parameters and evaluates them with eval before the session check is performed. Because parameter names are not restricted to a safe whitelist and are interpreted as shell code, a remote attacker can inject arbitrary shell commands directly through the HTTP request. This can lead to router reboot, denial of service, or full code execution.
Vulnerability chain:
QUERY_STRING.param, key, and val values:#QUERY_STRING=`urldecode "$QUERY_STRING"`
while [ true ]; do
param=${QUERY_STRING%%&*}
QUERY_STRING=${QUERY_STRING#*&}
val=${param#*=}
key=${param%=*}
eval "${key}='${val}'"
if [ "$param" = "$QUERY_STRING" ] || [ ${#param} -le 0 ]; then
break
fi
done
key:eval "${key}='${val}'"
sid:if [ ${#sid} -ne 32 ]; then
returnerrcode 6
exit
fi
ping or traceroute argument handling here; it is the earlier eval itself.