Commit 1220349
committed
docs(security): add path traversal warning to normalizePath()
Add security warning to normalizePath() JSDoc explaining that the function
resolves '..' patterns as part of normalization. Developers processing
untrusted user input (HTTP requests, file uploads, URL parameters) must
validate for path traversal attacks BEFORE calling this function.
Include examples showing how normalizePath() resolves traversal patterns:
- '/../etc/passwd' → '/etc/passwd'
- '/safe/../../unsafe' → '/unsafe'
This prevents misuse of normalizePath() on untrusted input where path
traversal validation should happen first.1 parent cc47920 commit 1220349
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
384 | 391 | | |
385 | 392 | | |
386 | 393 | | |
| |||
401 | 408 | | |
402 | 409 | | |
403 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
404 | 415 | | |
405 | 416 | | |
406 | 417 | | |
| |||
0 commit comments