You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(builtins): reject path traversal in patch diff headers (#1051)
## Summary
- Add `validate_path()` that rejects paths containing `..` components
after `strip_path()`
- Prevents crafted diff headers like `--- a/../../../etc/passwd` from
writing outside working directory
- Normal patch paths still work correctly
## Test plan
- [ ] `../../../etc/passwd` traversal rejected with error
- [ ] `foo/../../secret.txt` embedded traversal rejected
- [ ] Normal clean paths after strip still work
- [ ] All 20 patch unit tests pass
- [ ] All existing spec tests pass
Closes#989
0 commit comments