Skip to content

fix(skills): reject unsafe archive entry paths in spark_code_inspector. - #578

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1025690624
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1025690624

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix(skills): reject unsafe archive entry paths in spark_code_inspector.

disassemble_with_javap previously joined raw ZIP/JAR entry names onto its temporary directory without verifying path containment, allowing crafted archives with absolute entry names or ../ companion inner-class segments to write .class files outside the temporary directory.

Filter unsafe entry names in resolve_entry and find_inner_classes, enforce os.path.realpath and os.path.commonpath containment inside disassemble_with_javap, and add regression tests covering absolute paths, drive prefixes, and parent-directory traversal.

`disassemble_with_javap` previously joined raw ZIP/JAR entry names onto its temporary directory without verifying path containment, allowing crafted archives with absolute entry names or `../` companion inner-class segments to write `.class` files outside the temporary directory.

Filter unsafe entry names in `resolve_entry` and `find_inner_classes`, enforce `os.path.realpath` and `os.path.commonpath` containment inside `disassemble_with_javap`, and add regression tests covering absolute paths, drive prefixes, and parent-directory traversal.

PiperOrigin-RevId: 1025690624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant