제출 #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)
제출2026. 11. 03. AM 11:16 (24 날 ago)
모더레이션2026. 11. 27. PM 09:26 (24 days later)
상태수락
VulDB 항목445006 [Youzan ZanProxy 까지 5.1.0 Forwarding Rule Redirect rule.ts processRedirect target 디렉토리 순회]
포인트들20

Do you want to use VulDB in your project?

Use the official API to access entries easily!