Skip to content

[xabt] Validate extracted zip entry paths in ExtractJarsFromAar#11212

Draft
jonathanpeppers wants to merge 1 commit intomainfrom
dev/peppers/unzip-validation
Draft

[xabt] Validate extracted zip entry paths in ExtractJarsFromAar#11212
jonathanpeppers wants to merge 1 commit intomainfrom
dev/peppers/unzip-validation

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

This is just for correctness; there's no security enforcement here.

Add IsUnderDirectory check at both extraction points (jars and annotations) to silently skip zip entries whose resolved path escapes the target directory. Logs a debug message when an entry is skipped.

Add ExtractJarsFromAarTests with cases for jar traversal, annotations traversal, and a valid jar entry.

This is just for correctness; there's no security enforcement here.

Add `IsUnderDirectory` check at both extraction points (jars and
annotations) to silently skip zip entries whose resolved path escapes
the target directory. Logs a debug message when an entry is skipped.

Add `ExtractJarsFromAarTests` with cases for jar traversal, annotations
traversal, and a valid jar entry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant