/security-agent-skills:hunting-content-type-and-parser-confusionfrom security-agent-skills
Hunts content-type sniffing and parser confusion vulnerabilities where untrusted content is served or consumed with ambiguous types. Covers response sniffing, upload-filter bypass, polyglot files, charset-driven scripting, and multipart differentials.
Ships in security-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A stream of bytes has no inherent type; something decides whether it is HTML, JSON, an image, or a form. When that decision is ambiguous, the attacker gets to influence it. A browser that sniffs a response ignores a benign declared type and runs the HTML it finds inside. An upload filter that trusts the client type or the extension accepts a script disguised as an image. Two parsers on one path, a permissive multipart reader and a strict one, split a request differently and let content slip past the checker into the sink. A single file that is valid as two formats passes an image check and executes as markup. The bug is never the bytes; it is that the type is resolved by guessing rather than by an authoritative, enforced declaration. You find these by locating where content is typed and asking who decides and whether anyone can be made to disagree.
Test typing and parsing behavior only against applications you own or are authorized to assess, from test accounts, using benign markers rather than live payloads when you confirm that content is sniffed or a filter is bypassed. A confirmed stored case can execute in other users' sessions, so coordinate and stay in scope. If you can't name the authorization, stop.
Establish the declared type and whether it is enforced first. For each response that echoes user content and each parser that consumes untrusted bytes, determine what type is declared and whether it is authoritative: is a correct content type and a nosniff response directive set, and does the consumer honor the declared type instead of guessing? This is the false-positive killer. A response with the right type and nosniff will not be sniffed as HTML, and a parser that binds to one declared format cannot be confused, so name the declared type and its enforcement before crafting anything.
Map where content is typed and consumed. Trace responses that reflect or store user content, upload handlers and where they read the type, and every point where a body or document is parsed. Note each place the type is inferred (sniffed, taken from the extension, taken from the client header) rather than fixed by the server, because inference is where confusion enters.
Check response sniffing. For a response carrying user content, determine whether a browser could sniff it as HTML: a missing or generic type, a wrong charset, or content that starts with markup, without a nosniff directive, lets injected HTML run. A response with the correct type and nosniff, or served as a download with the right disposition, is not sniffable.
Check upload and parser typing. For uploads, determine whether the accepted type is decided by content inspection or by a trusted client value or extension; a filter that trusts the client accepts a disguised file. For bodies, check whether two parsers on the path could interpret the same bytes differently, so a value the checker reads is not the value the sink reads.
Check the polyglot and charset variants. Consider a single file valid as two formats that passes one parser's validation and is executed by another, and a charset the response omits that a browser infers to turn otherwise-inert bytes into script. Decide whether the pipeline forces a single unambiguous interpretation or leaves room for a second one.
Confirm and record. Confirm by serving or storing a benign marker that is inert under the intended
type but active under the confused one, and observing the confused interpretation reached, on an isolated
instance. Kill the lead if responses carry the correct type, charset, and nosniff, if uploads are typed by
content and served with a safe disposition and type, if a single parser binds the format unambiguously, or
if no consumer sniffs or re-types the content. Record the content, the deciding point, the forced
interpretation, and its impact, or set a kill_reason.
Confirm. An endpoint stores a user note and later serves it with a generic type and no nosniff directive. A note whose contents begin with markup is sniffed by the browser as HTML and its embedded script runs in another user's session on an isolated instance. Confirmed content-type sniffing to stored scripting,
high, remediation = serve user content with an exact non-HTML content type, a pinned charset, and a nosniff response directive, or return it as an attachment with a safe disposition.Kill. The same endpoint serves stored notes with an exact text content type, a pinned charset, and a nosniff directive, uploads are typed by content inspection and stored under a fixed non-executable type, and each body is parsed by a single format-bound parser. A note beginning with markup is delivered as inert text and never sniffed as HTML. Killed,
kill_reason= "user content is served with the correct type, charset, and nosniff, uploads are typed by content and served safely, and no second parser re-types the bytes; no consumer can be made to interpret them as HTML."
You need every response that echoes or stores user content with its declared type, charset, and nosniff state, every upload handler with how it decides the type and how it serves the file, and every point where a body or document is parsed, noting where two parsers could diverge. For each, decide whether the type is authoritatively fixed or inferred, and whether an attacker can force a second interpretation. Reading the response headers and the typing logic settles most leads; a marker that is inert under one type and active under another, on an isolated instance, settles the rest.
hunting-reflected-and-stored-xss - sniffing a response as HTML is one route to the same script execution
that skill hunts through output context; the two meet on responses that echo user content.auditing-file-upload-and-content-handling - the upload typing and safe-serving decisions are that skill's
core, so an upload-filter bypass through type confusion is shared ground.reviewing-content-security-policy - a strong policy limits what sniffed or injected markup can do, so a
weak policy and a sniffable response compound.hunting-http-parameter-pollution - the sibling shape where components disagree on parameter parsing
rather than on content type; both exploit two parties reading the same input differently.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub unboundcompute/security-agent-skills --plugin security-agent-skills194 skills in this plugin
/adjudicating-dependency-cve-reachabilityDecide whether a CVE in a dependency actually exposes your application before you scramble to patch: is the vulnerable function on a real call path from your code, do the trigger preconditions hold, and can an attacker control the input that reaches it. Use when an advisory, SCA scan, or dependency bot flags a CVE and you must separate a genuine exposure from unreachable noise, or justify why you are or are not affected. Covers pinning the vulnerable symbol, call-path reachability, precondition checks, and taint from your entry points./adjudicating-taint-pathsDecide whether a whitebox lead is a real bug by tracing taint from an untrusted source to a dangerous sink and confirming every hop against live source. Use after a scanner, a candidate list, or your own reading surfaces a "this looks dangerous" sink (SQL exec, system/exec, file open, deserialize, template render, redirect target, memcpy) and you must decide whether attacker- controlled input actually reaches it - or kill the lead with evidence. Covers forward and reverse taint, witness paths, sanitizer analysis, and the evidence rules that separate a finding from a false positive.Other plugins' skills for the same job