A polyglot file is one byte sequence that more than one parser can accept as a different format. That disagreement can bypass a filter when an upload gateway validates PDF while a later archive or image processor interprets ZIP, JPEG, or PNG structure.
tryb separates signature evidence from structural acceptance. A magic marker alone never earns a valid verdict: PDF needs bounded header, object, trailer or xref, and EOF evidence; ZIP needs coherent central-directory offsets and terminal records; JPEG and PNG need complete segment or chunk framing.
The analysis runs locally and supports four deliberately bounded models. A clean result does not prove safety in unsupported formats or predict every parser dialect; test the exact production parser chain in an authorized environment.
Edge cases worth knowing
- A PDF header inside arbitrary bytes
- The marker appears as evidence, but the PDF model stays invalid unless the remaining structural invariants are present.
- A self-extracting or prefixed ZIP
- ZIP may begin after another format. Its central-directory offsets must still resolve to real local records before tryb accepts it.
- Different parser dialects
- Some implementations accept malformed or extended files that this conservative model rejects. That is an unsupported or parser-specific state, not proof the bytes are harmless.
Common mistakes
- Calling two magic numbers a valid polyglot without checking structure.
- Assuming MIME labels or filename extensions describe how every downstream component will parse bytes.
- Treating acceptance by tryb's four bounded models as universal parser equivalence.
- Uploading sensitive files to a remote scanner when local byte analysis is sufficient.