Skip to content

host_orchestrator: reject archive entries that escape the extraction dir - #3015

Open
0405ysj wants to merge 2 commits into
google:version-1.55-devfrom
0405ysj:security_patch_1_55
Open

host_orchestrator: reject archive entries that escape the extraction dir#3015
0405ysj wants to merge 2 commits into
google:version-1.55-devfrom
0405ysj:security_patch_1_55

Conversation

@0405ysj

@0405ysj 0405ysj commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

The user-artifacts extractor (ExtractArtifact -> untar/unzip) joined attacker-controlled archive entry names onto the destination directory with no containment check and created symlink entries verbatim, allowing a crafted .tar.gz/.zip to write files outside the extraction directory

Add isSafeToExtract() and use it in untar and unzip to verify each entry's resolved path stays within the destination, and reuse it to reject symlink entries whose resolved target escapes it. Add regression tests for the tar-traversal, tar-symlink and zip-traversal vectors.

The user-artifacts extractor (ExtractArtifact -> untar/unzip) joined
attacker-controlled archive entry names onto the destination directory
with no containment check and created symlink entries verbatim, allowing
a crafted .tar.gz/.zip to write files outside the extraction directory

Add isSafeToExtract() and use it in untar and unzip to verify each
entry's resolved path stays within the destination, and reuse it to
reject symlink entries whose resolved target escapes it. Add regression
tests for the tar-traversal, tar-symlink and zip-traversal vectors.
@0405ysj 0405ysj added the kokoro:force-run Trigger a presubmit build unconditionally. label Aug 13, 2026
@0405ysj
0405ysj requested review from ikicha and k311093 August 13, 2026 04:15
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:force-run Trigger a presubmit build unconditionally. label Aug 13, 2026
@0405ysj
0405ysj marked this pull request as ready for review August 13, 2026 04:15
@0405ysj 0405ysj added the kokoro:force-run Trigger a presubmit build unconditionally. label Aug 13, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:force-run Trigger a presubmit build unconditionally. label Aug 13, 2026
@0405ysj 0405ysj added the kokoro:force-run Trigger a presubmit build unconditionally. label Aug 13, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:force-run Trigger a presubmit build unconditionally. label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants