Defend against MIME / content-type sniffing: enforce X-Content-Type-Options nosniff, accurate Content-Type, safe user-upload serve paths, and polyglot body risks that browsers re-interpret as HTML/script. Use when hardening or auditing response headers for user content, static hosts, CDN file origins, missing nosniff, wrong MIME on uploads, or MIME-confusion XSS on owned apps and authorized assessments.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Defend against MIME / content-type sniffing: enforce X-Content-Type-Options nosniff, accurate Content-Type, safe user-upload serve paths, and polyglot body risks that browsers re-interpret as HTML/script. Use when hardening or auditing response headers for user content, static hosts, CDN file origins, missing nosniff, wrong MIME on uploads, or MIME-confusion XSS on owned apps and authorized assessments.
Content-Type Sniffing Defense
Stop browsers from reinterpreting responses as HTML, script, or media other
than the declared type. Owns MIME correctness + nosniff + serve-time policy.
Storage keys/AV → file-upload-secure-storage. Disposition / download →
download-attribute-security. Script execution impact → xss-cross-site-scripting.
Scope And Authorization
In scope: Owned apps, labs, CTFs, written-scope review of response headers,
user-file hosts, CDN/object GET, exports, previews that may sniff or mislabel.
Out of scope: Drive-by malware, phishing, or third-party origins without
authorization.
Prefer canary bodies (MIME-SNIFF-CANARY-<uuid>) and lab browser profiles.
Prove sniff/execute with markers only. Keep originals immutable; store captures
under derived paths. Redact cookies, signed URLs, tokens, PII. Do not infer
authorization from sandbox-looking UIs.
When To Use
Missing X-Content-Type-Options: nosniff (site-wide or on user-content hosts).
Served Content-Type is wrong, generic (text/plain, application/octet-stream),
client-supplied, or disagrees with magic/extension.
User uploads (HTML, SVG, XML, PDF, images) re-served inline on the app
cookie origin without isolation.
Polyglot/dual-parse files may be treated as HTML/JS when type/nosniff is weak.
Hardening: global nosniff, fixed server MIME map, attachment defaults, separate
file origin, tests that canary HTML never runs on the app origin.
Not primary: storage/AV/noexec → file-upload-secure-storage; disposition /
HTML download → download-attribute-security; full XSS sink mapping →
xss-cross-site-scripting; zip extract → zip-slip-path-safety; edge-only
header inventory → nginx-security-headers (use this for MIME/sniff depth).
Multi-format bodies (image+HTML, PDF gadgets) may bypass naïve extension checks.
Defense-in-depth: magic+ext at store; fixed serve type + nosniff; separate
origin; re-encode images; no inline SVG on app origin.
Deep ingest dual-parse → file-upload-polyglot-detection. This skill covers
serve-time sniff outcomes when polyglot bytes reach the browser.
6. Prove impact and remediate
Lab-only: serve canary HTML/SVG under mislabeled type; check execute vs download
vs blocked with/without nosniff on target origin.
Script in victim session → MIME-confusion XSS; hand exploit depth to
xss-cross-site-scripting; keep header/MIME fixes here.
With code-quality-standards: always set nosniff; Content-Type from server map
only; untrusted default attachment; isolate user-content host; test missing
nosniff, wrong MIME, and “canary HTML must not run on app origin.”