| 제목 | youzan ZanProxy 5.1.0 Path Traversal (CWE-22) |
|---|
| 설명 | ZanProxy 5.1.0 exposes unauthenticated mock-data operations through its Manager service, which listens on x.x.x.x:40001 by default. GET /mock/data?id=<id> returns the selected file as UTF-8 text, while POST /mock/data?id=<id> writes the JSON body field content. The controller in src/core/manager/controller/mock.ts passes id to the mock-data service without restricting it.
In src/core/services/mock.ts, getDataFilePath uses path.join(mockDataDir, id) without checking that the resolved path remains inside mockDataDir. The path join resolves ../ components, allowing a requester to escape that directory. The write operation uses fs.ensureFile followed by fs.writeFile, and can create missing directories where the application account has permission.
The report's PoC uses a traversal id to read a file and writes a marker outside the mock-data directory, then reads it back. A client able to reach the Manager can read or overwrite UTF-8 files accessible to the ZanProxy user, potentially including configuration files or the application's HTTPS interception private key. |
|---|
| 원천 | ⚠️ https://github.com/youzan/zan-proxy/issues/155 |
|---|
| 사용자 | fifker (UID 101353) |
|---|
| 제출 | 2026. 11. 12. PM 02:23 (22 날 ago) |
|---|
| 모더레이션 | 2026. 12. 04. PM 01:26 (22 days later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 449730 [Youzan ZanProxy 5.0.0/5.1.0 Mock Data Service mock.ts getDataFilePath id 디렉토리 순회] |
|---|
| 포인트들 | 20 |
|---|