Commit 144b060
committed
fix(arborist): sanitize packageName through nameFromFolder in proxy objects
The proxy objects used in .store path construction got packageName
directly from node.packageName (raw package.json name) without
sanitization. nameFromFolder was only used as a fallback when
packageName was null.
Now wraps the primary source through nameFromFolder so traversal
sequences like ../../evil in package.json name fields are stripped
before reaching path.join in store path construction.1 parent f9877e8 commit 144b060
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
0 commit comments