Repository navigation
Commit 7bcaa49
authored
donate-cpu-server: do not serve files outside the result path (#8945)
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.1 parent ad19835 commit 7bcaa49
2 files changed
Lines changed: 32 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1275 | 1275 | | |
1276 | 1276 | | |
1277 | 1277 | | |
1278 | | - | |
1279 | | - | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1280 | 1281 | | |
1281 | 1282 | | |
1282 | 1283 | | |
| |||
0 commit comments