Commit ae4c7dc
MNT Fix path traversal issue in archive extraction (#4924)
The `_is_attempting_path_traversal` function did not properly handle
absolute paths, allowing a maliciously crafted archive to write files
outside of the intended extraction directory.
This patch fixes the issue by:
- Adding a check to explicitly disallow absolute paths in archive
members.
- Improving the relative path traversal check to ensure that the
resolved path of an archive member is always within the intended output
directory.
b/431292024
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 25a9973 commit ae4c7dc
File tree
2 files changed
+37
-11
lines changed- src/clusterfuzz/_internal
- system
- tests/core/system
2 files changed
+37
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 68 | + | |
77 | 69 | | |
78 | | - | |
79 | | - | |
| 70 | + | |
80 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
54 | 79 | | |
55 | 80 | | |
56 | 81 | | |
| |||
0 commit comments