Skip to content

Validate tar archive member paths before extraction in testing layer - #856

Open
theluckystrike wants to merge 1 commit into
crate:mainfrom
theluckystrike:fix/safe-tar-extract-layer
Open

theluckystrike wants to merge 1 commit into
crate:mainfrom
theluckystrike:fix/safe-tar-extract-layer

Conversation

@theluckystrike

Copy link
Copy Markdown

Fixes #794.

In src/crate/testing/layer.py, tarfile.extractall(directory) extracted archive members without validating resolved paths against the destination directory. Check every member path and link target stays within os.path.realpath(directory) before calling extractall.

@mergify

mergify Bot commented Dec 2, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

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.

[Security] tarfile.extractall without member validation in src/crate/testing/layer.py

1 participant