trailofbits / polyfile

A pure Python cleanroom implementation of libmagic, with instrumented parsing from Kaitai struct and an interactive hex viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to identify some ZIP files

DavidBuchanan314 opened this issue · comments

For example, this one:

bggp

In fact, the only filetype identified is PNG.

Not detecting the PDF is understandable, since it's out-of-spec - the header appears too far into the file - although Firefox can still render it.

As of version v0.3.0, PolyFile uses the libmagic file definition database (also used for the file command). Unfortunately, this database is rather strict, and only classifies this file as a PNG. You can confirm this by running file -k polyglot.png. We are in the process of relaxing these definitions such that more formats would be detected in this file. We expect this to be included in the next release (v0.3.5).