fix(vcs): no project can write into .git or .vcs; hostile input can't crash the host
Radin committed
- Author
- Radin · radin@coline.appOct 28, 2026 at 02:06
- Committer
- Radin · radin@coline.appOct 28, 2026 at 02:06
- Parents
- 8207c3629fab
fix(vcs): no project can write into .git or .vcs; hostile input can't crash the host Path safety, as git learned it (CVE-2014-9390 and later): - A path part can't be .git or .vcs in any spelling a disk treats the same (.GIT, .git., git~1, with characters macOS ignores), nor hold a backslash. Hosts refuse to land one (Upstream's host, vcs-server, edits, imports); importers leave them out; the CLI refuses to write one, never picks up a nested .git or .vcs folder, and on Windows refuses names Windows can't hold (aux.c, a:b) instead of writing somewhere else. Otherwise anyone who can land could plant .git/hooks in others' folders. Hostile bytes: - core/tests/hostile.rs mutates valid bundles, trees, chunk lists, git packs, deltas, commits and git trees, and makes random ones (about 40,000 each; VCS_FUZZ_SCALE for more), and requires errors, not panics. - It found that a git delta's claimed size was allocated as is: a crafted push to git main could have crashed the host's isolate. Deltas now draw from the pack's budget. - A compressed object's claimed size isn't trusted either (host and CLI): room grows as it's read, reading stops just past it, and the host opens objects up to 32 MiB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 files changed+401−20