content-sniffing · shipping · also MIME sniffing, MIME type sniffing

Content sniffing

Content sniffing is the process of using resource bytes and contextual metadata to determine a media type for processing.

Supplied versus computed: WHATWG distinguishes a supplied MIME type from the type computed for a resource. Sniffing rules depend on context, such as image loading versus browsing. The result selects an interpretation; it is not a full format-validation or integrity check. [1]

Historical evidence: Barth, Caballero and Song analyzed four browser implementations and compared their sniffers with upload filters. Their IEEE S&P 2009 paper identified interpretation disagreements and proposed avoiding privilege escalation and using prefix-disjoint signatures. Those findings concern historical implementations, not a measured vulnerability in current browsers. [2]

Storage consequence: Preserving identical object bytes does not preserve the HTTP processing contract when delivery metadata changes. Record and verify Content-Type separately from the checksum. RFC 9110 identifies Content-Type as a singleton; a comma-joined pair of types is not a valid list-valued alternative. [3]

Scope: Neither a filename extension nor a matched prefix proves the entire object is well formed. Correct type metadata, integrity verification and validation of the selected format answer different questions. Do not use a successful type guess as an archive-restore acceptance test. [3]

Relations

related
Media type, File signature, Object storage

Citations

  1. WHATWG MIME Sniffing: resource metadata, computed types and context-specific sniffing (accessed 2026-11-23)
  2. Barth, Caballero and Song (IEEE S&P 2009): Secure Content Sniffing for Web Browsers, sections 2-3 (accessed 2026-11-23)
  3. RFC 9110, section 8.3: Content-Type (accessed 2026-11-23)

Further reading

  1. Hesela: identify the format, then validate the file (accessed 2026-11-23)
Sources & caveats
  • Primary-source synthesis of HTTP semantics, the WHATWG processing model and historical browser research; no new browser-security experiment or fleet measurement.

JSON: /data/terms/content-sniffing.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Content sniffing. Hesela. 2026-11-23. https://hesela.dev/terms/content-sniffing/