Skip to content

detect legacy lzma alone streams when routing archives - #44

Open
abdul-khaliq-khalid wants to merge 1 commit into
google:mainfrom
abdul-khaliq-khalid:lzma-alone-detection
Open

detect legacy lzma alone streams when routing archives#44
abdul-khaliq-khalid wants to merge 1 commit into
google:mainfrom
abdul-khaliq-khalid:lzma-alone-detection

Conversation

@abdul-khaliq-khalid

Copy link
Copy Markdown

Archive routing keys lzma detection on the xz magic \xfd7zXZ\x00, but the legacy alone (.lzma) container has no magic bytes and extract_lzma_contents opens it anyway through lzma.open's FORMAT_AUTO. A malicious pickle scores unsafe=3 raw and inside an xz stream but unsafe=0 when wrapped as a bare .lzma stream, since its contents are never routed to the lzma branch and never scanned. Added is_lzma_alone_bytes, which validates the 13-byte alone header (properties byte, power-of-two dictionary size, uncompressed-size field), and routed the archive-detection sites through it next to the existing xz check.

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