Commit 93c9825
fix: return resolved path from validatePath to prevent symlink write bypass
Previously, validatePath() resolved symlinks for the allowlist check but
returned the original (unresolved) path. This meant callers like writeFile()
and createDirectory() would still operate on the symlink path, following it
to the restricted target. Now validatePath() consistently returns the
resolved (canonical) path so all subsequent file operations use the real
target path, closing the symlink write bypass vector.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent afc7a6c commit 93c9825
1 file changed
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
291 | 296 | | |
292 | 297 | | |
293 | 298 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 299 | + | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
| 303 | + | |
| 304 | + | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | | - | |
309 | | - | |
| 308 | + | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
0 commit comments