Отправить #1071458: youzan ZanProxy 5.1.0 Path TraversalИнформация

Названиеyouzan ZanProxy 5.1.0 Path Traversal
ОписаниеZanProxy 5.1.0 allows an unauthenticated attacker who can reach both the Manager service and the proxy service to read local files accessible to the ZanProxy process. By default, the Manager listens on x.x.x.x:40001 and the proxy listens on x.x.x.x:8001; actual network exposure also depends on the host firewall and network configuration. The endpoint POST /rule/save?name=<rule-name> accepts a complete forwarding rule, including an attacker-controlled redirect target. In src/core/manager/controller/rule.ts, the request body is passed to saveRuleFile. The endpoint POST /profile/rule/toggle accepts {"enable":true} and enables rule processing. For a matching proxy request, src/core/proxy/middleware/rule.ts calculates the redirect target and passes a target that does not start with "http" or "ws" to fs.createReadStream, returning the file contents in the HTTP response. The server does not require authentication for the rule changes or restrict the local redirect target to a designated directory. Reproduction on Windows: 1. On the machine running ZanProxy, create C:\Users\Public\zanproxy-canary.txt with the content ZANPROXY-TEST-123. 2. Send POST /rule/save?name=poc-zp152 to the Manager on port 40001 with Content-Type: application/json and this body: {"meta":{"remote":false},"checked":true,"name":"poc-zp152","description":"","content":[{"key":"zp152","name":"zp152","method":"GET","match":"zp152","checked":true,"actionList":[{"type":"redirect","data":{"target":"C:\\Users\\Public\\zanproxy-canary.txt"}}]}]} 3. Send POST /profile/rule/toggle to the Manager with Content-Type: application/json and body {"enable":true}. 4. Send an absolute-form request for http://rawread.invalid/zp152 through the proxy on port 8001. If the rule is active, the response body contains ZANPROXY-TEST-123; the destination domain does not need to exist. The public report describes a proof of concept that checks a random 4096-byte test file against the bytes returned by the proxy. An attacker can target other files readable by the application, potentially including the HTTPS interception root CA private key. Saved rules persist across restarts. This report concerns the forwarding-rule redirect chain; it is distinct from the /mock/data file-read/write issue in #155. Full proof of concept and source references: https://github.com/youzan/zan-proxy/issues/152
Источник⚠️ https://github.com/youzan/zan-proxy/issues/152
Пользователь
 fifker (UID 101353)
Представление03.11.2026 11:16 (24 дни назад)
Модерация27.11.2026 21:26 (24 days later)
Статуспринято
Запись VulDB445006 [Youzan ZanProxy до 5.1.0 Forwarding Rule Redirect rule.ts processRedirect target обход каталога]
Баллы20

Do you need the next level of professionalism?

Upgrade your account now!