Repository navigation
fix(client): restore system tar for extraction - #448
Merged
Merged
Conversation
#418 replaced `tar -xpf` with an in-process extractor that validates entry paths and symlink targets. Clients only extract archives that cachew service accounts wrote, so there is no untrusted input to defend against, and the extractor had real costs: - ~35% slower on trees of many small files (Go source tree: 5.6s -> 7.6s), mostly from repeated Lstat calls on every parent directory. - It rejected legitimate absolute or out-of-tree symlinks, so trees such as Python virtualenvs could no longer be restored. Extract now documents that cachew must only accept writes from trusted sources. Request-path validation and GitHub URL escaping from #418 are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alecthomas
marked this pull request as ready for review
November 13, 2026 00:41
alecthomas
requested review from
jrobotham-square
and removed request for
a team
November 13, 2026 00:41
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
worstell
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#418 replaced the
zstd | tar -xpfpipeline inclient.Extractwith an in-process Go extractor that validates entry paths, symlink targets and hard links. That hardening only matters if clients can be handed a malicious archive, but clients only extract archives that cachew service accounts wrote, so there is no untrusted input to defend against. The extractor did have real costs:Lstat, because every file re-checks each parent directory twice before it is written. Trees of a few large files were faster with Go, but those are not the common case.cachew restore.This restores the pre-#418
Extractand documents that its input must be trusted, so cachew must only allow writes from trusted sources. The Go-extractor-specific tests are removed, and a new test checks that absolute and../symlinks survive a save and restore. The rest of #418 is unchanged: request-path validation, per-strategy path checks, GitHub URL escaping, and theArchiveinclude-path check.The benchmark was run on macOS with bsdtar, not on Linux with GNU tar.
🤖 Generated with Claude Code