Commit 681811d
committed
fix(react-scripts): prevent path traversal in template copy
Add filter and dereference options to fs.copySync in init.js to prevent
malicious templates from writing files outside the target app directory.
The filter validates that each resolved destination path stays within
appPath, blocking path traversal via '../' patterns and symlinks.
Signed-off-by: Srikanth Patchava <spatchava@meta.com>1 parent d64e1b2 commit 681811d
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
236 | 245 | | |
237 | 246 | | |
238 | 247 | | |
| |||
0 commit comments