| 标题 | TOTOLINK A7100ru V7.4cu.2313 Command Injection |
|---|
| 描述 | 1. Summary
TOTOLINK A7100RU firmware V7.4cu.2313_B20191024 contains a pre-authentication OS command injection in the exportOvpn handler of /cgi-bin/cstecgi.cgi. The username query parameter is passed to snprintf(..., "openvpn-cert build_user %s gz", value) and then to system() without shell escaping. The exportOvpn branch also lacks authentication. An unauthenticated attacker can execute arbitrary commands as root.
• Type: OS Command Injection (CWE-78)
• CVSS 3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H = 9.8
• Affected version: V7.4cu.2313_B20191024
• Status: no same-model/same-version CVE or CNVD entry found as of 2026-10-23.
2. Affected Product
Item Value
Vendor TOTOLINK / Zioncom
Product A7100RU
Hardware version V1 (per vendor page)
Firmware V7.4cu.2313_B20191024
Firmware build date 2019-10-24
Firmware package a7100ru-a7100ru-v74cu2313-b20191024-all.zip
Download https://totolink.ru/assets/template/files/a7100ru-a7100ru-v74cu2313-b20191024-all.zip
Version self-ID /etc/product: softVersion 'V7.4cu.2313', svnNum '2313'
3. Vulnerable Component
• Request path: /cgi-bin/cstecgi.cgi
• Firmware path: /usr/lib/lighttpd/web/cgi-bin/cstecgi.cgi
• Architecture: MIPS32 little-endian, dynamically linked, interpreter /lib/ld-uClibc.so.0
• Size: 263,879 bytes
• SHA256: 9fb6deba000ddcca177365e23bb9050b0269ec7443051db4ed64daf87b06bce4
• Endpoint: action=exportOvpn&type=user&username=<value>&filetype=gz
4. Root Cause
main() parses QUERY_STRING. In the type=user branch, it extracts the value after '=' in the third &-delimited parameter (username) and passes it directly to the command string:
getNthValueSafe(1, query, '&', _2nd_queryargv, 128); // type=user
getNthValueSafe(3, query, '&', _4th_queryargv, 64); // filetype
...
getNthValueSafe(2, query, '&', buffer_2, 128); // username=...
getNthValueSafe(1, buffer_2, '=', value, 128); // value
if ( _4th_queryargv[0] && !strcmp(_4th_queryargv, "filetype=gz") )
{
snprintf(v53, 256, "openvpn-cert build_user %s gz", value);
system(v53);
}
else
{
snprintf(v53, 256, "openvpn-cert build_user %s config", value);
system(v53);
}
The value is only length-limited (128 bytes) and is not escaped for shell metacharacters. Both the gz and config branches reach system().
5. Why the Issue Is Pre-Authentication
• lighttpd.conf does not load mod_auth; auth.backend and auth.require are commented out; the /cgi-bin/ block only sets cgi.assign.
• The exportOvpn branch has no login_flag, session, or cookie check.
• The proof-of-concept request contains no Cookie/Session header and still executes commands.
6. Reproduction
Environment: official firmware, unpacked and run in full-system QEMU (MIPS Malta). No physical device was used. lighttpd listens on 127.0.0.1:80 inside the emulated guest.
Request:
GET /cgi-bin/cstecgi.cgi?action=exportOvpn&type=user&username=;id>/tmp/pwned;&filetype=gz HTTP/1.1
Host: 127.0.0.1
Connection: close
Result:
/tmp/pwned contains:
uid=0(root) gid=0(root)
The command executed by the CGI is equivalent to:
openvpn-cert build_user ;id>/tmp/pwned; gz
Negative control: username=test does not create the file.
Encoding note: %20 is not decoded by this firmware, and ${IFS}/$IFS did not work in testing. A no-space payload such as ;id>/tmp/pwned; works reliably.
7. Impact
Unauthenticated remote command execution as root. An attacker can read or modify device configuration, access sensitive files, establish a reverse shell, and use the router as a pivot point. The device is typically located at a network boundary, so compromise of the management interface can lead to full device takeover.
8. Relation to Existing CVEs
The same exportOvpn sink has been reported for other TOTOLINK models:
CVE Product Type / Parameter Auth CVSS
CVE-2022-26186 N600R exportOvpn command injection PR:N 9.8
CVE-2024-8869 A720R exportOvpn OS command injection - 8.1 / 5.0
CVE-2024-8079 AC1200 T8 exportOvpn buffer overflow - -
CVE-2026-15204 X5000R exportOvpn path traversal - -
CVE-2026-91853 X5000R exportOvpn / filetype PR:L 7.4
This finding A7100RU exportOvpn / username PR:N 9.8
This report is for a different product and firmware version (A7100RU V7.4cu.2313_B20191024), a different parameter (username), and is pre-authentication (PR:N), unlike CVE-2026-91853 (PR:L). TOTOLINK has a history of separate per-model CVE assignments for the same exportOvpn issue.
9. Search for an Existing Entry
• NVD TOTOLINK A7100RU: 77 records; none mention exportOvpn, openvpn-cert, or build_user.
• NVD exportOvpn: 5 records, all other models.
• CNVD retrievable records map to other CVEs; no exportOvpn entry found. The CNVD website returned HTTP 521 on 2026-10-23, so this is not a full CNVD search.
• Litengzheng/vuldb_new: 43 A7100RU entries (CVE-2026-5850 to 6195 plus unnumbered); none for exportOvpn.
10. Remediation
• Replace system() with execve() / posix_spawn() and an argv array.
• Allowlist the username value (for example [A-Za-z0-9_-]).
• Require authentication before the exportOvpn branch.
• Run the CGI with reduced privileges.
11. Test Limitations
• Official firmware + full-system QEMU; no physical device was used.
• WAN-side exposure was not tested; the finding proves pre-auth RCE when the management interface is reachable.
• Vendor has not provided a fix as of the report date.
12. References
https://totolink.ru/assets/template/files/a7100ru-a7100ru-v74cu2313-b20191024-all.zip
https://nvd.nist.gov/vuln/detail/CVE-2022-26186
https://nvd.nist.gov/vuln/detail/CVE-2024-8869
https://nvd.nist.gov/vuln/detail/CVE-2024-8079
https://nvd.nist.gov/vuln/detail/CVE-2026-15204
https://nvd.nist.gov/vuln/detail/CVE-2026-91853
13. Discoverer
pgldxx
[email protected] |
|---|
| 来源 | ⚠️ https://totolink.ru/assets/template/files/a7100ru-a7100ru-v74cu2313-b20191024-all.zip |
|---|
| 用户 | pgldxx (UID 102443) |
|---|
| 提交 | 2026-10-23 18時38分 (1 月前) |
|---|
| 管理 | 2026-11-23 04時22分 (1 month later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 442238 [TOTOLINK A7100RU 7.4cu.2313_B20191024 CGI /cgi-bin/cstecgi.cgi exportOvpn username 权限提升] |
|---|
| 积分 | 20 |
|---|