Commit 18d5c06
committed
## Vulnerability Details
Location: Line 63 in project-packer.ts
typescript
const command = `find ${dirPath} -type d -name .git -prune -o -type f -not -path "*/\\.*" | sort`;
const output = execSync(command, { encoding: 'utf8' });
## Attack Vector
1. User uploads a zip file via /api/storage/work-items/upload-files
2. Zip file is extracted to a temporary directory using unzipBuffer()
3. Directory path is passed unsanitized to generateDirectoryTree(dirPath)
4. Command injection occurs when dirPath is directly interpolated into the shell command
## Exploitation Scenario
An attacker can create a zip file containing a directory with a malicious name like:
/tmp/project-; rm -rf / #
When extracted and processed, this becomes:
bash
find /tmp/project-; rm -rf / # -type d -name .git -prune -o -type f -not -path "*/\\.*" | sort
This executes rm -rf / on the server.
## Risk Level: CRITICAL
• **Impact**: Complete system compromise (RCE)
• **Likelihood**: High (easily exploitable via file upload)
• **Authentication**: Required (but trivial barrier)1 parent 02c4973 commit 18d5c06
File tree
1 file changed
+70
-38
lines changed1 file changed
+70
-38
lines changedLines changed: 70 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 61 | + | |
| 62 | + | |
98 | 63 | | |
99 | 64 | | |
100 | 65 | | |
101 | 66 | | |
102 | 67 | | |
103 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
104 | 136 | | |
105 | 137 | | |
106 | 138 | | |
| |||
0 commit comments