Skip to content

donate-cpu-server: do not serve files outside the result path - #8945

Open
Nussu06 wants to merge 1 commit into
cppcheck-opensource:mainfrom
Nussu06:donate-cpu-server-path-traversal
Open

Nussu06 wants to merge 1 commit into
cppcheck-opensource:mainfrom
Nussu06:donate-cpu-server-path-traversal

Conversation

@Nussu06

@Nussu06 Nussu06 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

the fallback branch in HttpClientThread.run serves self.resultPath + url for any GET path that is not a known report, and the path from parse_req is not normalized. a raw request like GET /../../../etc/passwd HTTP/1.1 (browsers collapse the dots, a socket or curl --path-as-is does not) gets back any text file the daca server user can read. normalize the joined path and answer 404 unless it stays under the result path, so package results and info_output/ files are served as before. test_file_outside_result_path in test/tools/donate_cpu_server_test.py fails without the change. there is no trac ticket for this yet, please create one or let me know and i will update the title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant