Commit a35d528
committed
fix(arborist): sanitize packageName in path construction for linked strategy
Node.packageName returns raw package.json name without validation
(syncNormalize doesn't include fixName). This allows path traversal
via malicious package names from file: deps or private registries.
Changes:
- Add packageName getter to IsolatedNode deriving safe names via
nameFromFolder(path)
- Wrap node.packageName through nameFromFolder in #assignCommonProperties
so proxy objects get path-safe names
- Fix hasShrinkwrap branch to use sanitized result.packageName instead
of raw node.packageName in mkdirSync path construction1 parent 21ea382 commit a35d528
File tree
2 files changed
+8
-2
lines changed- workspaces/arborist/lib
- arborist
2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| |||
0 commit comments