Web failure classes
These classes recur because frameworks make the unsafe version shorter to write. Finding them is
reading for a pattern — untrusted input reaching somewhere that treats it as instruction — not
reciting a taxonomy. A class you name without a file and a path is not a finding.
When this fires
Code that receives requests, builds queries, renders output, fetches URLs, parses serialized data,
handles sessions or accepts files is being written or reviewed. Use it inside a review pass, or on
its own when asked to sweep an app for the usual suspects.
Procedure
- Enumerate the untrusted entry points first. Route tables and handlers, GraphQL resolvers
and their nested fields, webhook receivers, queue consumers, file uploads, CLI and admin
scripts, anything parsing a header or cookie. Every class below is checked from these, not by
browsing files alphabetically.
- Broken access control, before anything else. It is the most common and the least visible to
tooling. Look for a handler taking an id from the path, body or query and fetching without
scoping to the caller; middleware applied by opt-in so a new route is unprotected by default;
bulk and batch endpoints checking only the first item; a role or tenant id read from the
request. See the
authorization skill for the model itself.
- Injection — find where data reaches an interpreter as syntax. SQL built by concatenation or
template literals, an ORM's raw escape hatch, a shell invoked with a command string rather than
an argument vector, a query object built straight from a JSON body, an LDAP or XPath filter, a
template rendered from a user-supplied string,
eval and its relatives. The fix is
parameterization or passing arguments as data — hand-rolled escaping is a defect with a delay.
- XSS is an output-context question. Ask where the string lands: HTML body, attribute, URL
attribute, inside a script, inside CSS. Look for raw-HTML sinks (
innerHTML and each
framework's dangerous-HTML prop), auto-escaping turned off, user text interpolated into an
inline script or a href, Markdown rendered to HTML without sanitisation, and SVG or HTML
uploads served from the app's own origin. Escaping correct for one context is wrong in another.
- SSRF — anywhere the server fetches a URL a user influenced. Webhook targets, avatar and
image fetchers, link previews, PDF and screenshot renderers, import-from-URL, identity
discovery documents. Check for an allowlist of destinations, whether redirects are followed
blindly, and whether the check happens before or after DNS resolution. Blocking metadata
addresses by string match is not a control: alternate encodings, IPv6, redirects and rebinding
all walk past it.
- Deserialization and object binding. Untrusted bytes reaching a language's native
deserializer, a YAML loader that constructs arbitrary types, or JSON that names its own class,
is remote code execution waiting for a gadget. Alongside it: mass assignment binding a whole
request body onto a model (
isAdmin arrives free), and merge helpers in JavaScript that let a
body reach the prototype chain.
- Sessions and tokens. Where is a session created, rotated on privilege change, and
invalidated on logout and password change? Cookie flags set? Password-reset tokens random,
single-use and short-lived? For signed tokens, check that verification pins the algorithm and
the key and checks expiry and audience — accepting whatever algorithm the token names is the
classic hole.
- Secrets and inadvertent disclosure. Keys committed to the repository or baked into a client
bundle by a public-prefixed environment variable, tokens in URLs and logs, stack traces and
debug routes reachable in production, error messages distinguishing "no such user" from "wrong
password" where that matters.
- File handling. Path traversal in download and upload names, archive extraction writing
outside its target directory, trusting a client-declared content type, and serving user files
from the application's origin where they inherit its cookies and permissions.
- Dependencies: audit output is leads, not findings. Run the ecosystem's audit, then check
whether the vulnerable code path is actually reachable from step 1's entry points. Reporting an
advisory list as a security review is how real findings get ignored.
- Confirm reachability before reporting. Source, sink, and a path between them that survives
the checks in between. Without that path, report it as hardening and label it so.
Sending payloads at a running system is a different act from reading code. It stops and asks
first, names the target, and does not happen against production or anything the user has not said
they own. Reading is always in scope; probing is not implied by it.
Checklist
Failure handling
- The pattern appears but the input turns out to be trusted — drop it or downgrade it to
hardening. A false positive costs more than a missed low-severity issue: it teaches the reader to
skim.
- A framework may already neutralise it — check the framework's actual behaviour for that
version rather than assuming either way, and say which behaviour you relied on.
- The sink is reached through code you cannot follow (dynamic dispatch, generated code, a
vendored blob) — report it as an unresolved path with what you traced, not as safe.
- A class cannot be checked at all — no access to the templates, the infra config, the
dependency lockfile — name it as unchecked in the report. Silence reads as a pass.
- Something looks exploitable — that is a hypothesis until it is run by someone authorized to
run it. Write it as "reachable by inspection", not "exploitable".
Evidence to report
Per finding: file and line, the untrusted input, the sink, the path between them, the concrete
consequence to a named asset, and the smallest fix. Per review: which entry points were
enumerated, which classes were checked, which were not checked and why, audit output with its
reachability triage, and everything reasoned about but not run, said so plainly.
1---2name: owasp-web3description: Hunt the web failure classes that actually recur — broken access control, injection, XSS by output context, SSRF, unsafe deserialization and mass assignment, session and token handling, secrets leakage, file handling — as patterns to find in this codebase. Use when writing or reviewing request handlers, queries, URL fetches, templates, uploads or auth code, or when asked to check a web app for the common vulnerability classes. Not for design-stage modeling (threat-modeling), not infrastructure or network hardening, and not a list to recite without reading code.4---56# Web failure classes78These classes recur because frameworks make the unsafe version shorter to write. Finding them is9reading for a pattern — untrusted input reaching somewhere that treats it as instruction — not10reciting a taxonomy. A class you name without a file and a path is not a finding.1112## When this fires1314Code that receives requests, builds queries, renders output, fetches URLs, parses serialized data,15handles sessions or accepts files is being written or reviewed. Use it inside a review pass, or on16its own when asked to sweep an app for the usual suspects.1718## Procedure19201. **Enumerate the untrusted entry points first.** Route tables and handlers, GraphQL resolvers21 and their nested fields, webhook receivers, queue consumers, file uploads, CLI and admin22 scripts, anything parsing a header or cookie. Every class below is checked *from* these, not by23 browsing files alphabetically.242. **Broken access control, before anything else.** It is the most common and the least visible to25 tooling. Look for a handler taking an id from the path, body or query and fetching without26 scoping to the caller; middleware applied by opt-in so a new route is unprotected by default;27 bulk and batch endpoints checking only the first item; a role or tenant id read from the28 request. See the `authorization` skill for the model itself.293. **Injection — find where data reaches an interpreter as syntax.** SQL built by concatenation or30 template literals, an ORM's raw escape hatch, a shell invoked with a command string rather than31 an argument vector, a query object built straight from a JSON body, an LDAP or XPath filter, a32 template rendered from a user-supplied string, `eval` and its relatives. The fix is33 parameterization or passing arguments as data — hand-rolled escaping is a defect with a delay.344. **XSS is an output-context question.** Ask where the string lands: HTML body, attribute, URL35 attribute, inside a script, inside CSS. Look for raw-HTML sinks (`innerHTML` and each36 framework's dangerous-HTML prop), auto-escaping turned off, user text interpolated into an37 inline script or a `href`, Markdown rendered to HTML without sanitisation, and SVG or HTML38 uploads served from the app's own origin. Escaping correct for one context is wrong in another.395. **SSRF — anywhere the server fetches a URL a user influenced.** Webhook targets, avatar and40 image fetchers, link previews, PDF and screenshot renderers, import-from-URL, identity41 discovery documents. Check for an allowlist of destinations, whether redirects are followed42 blindly, and whether the check happens before or after DNS resolution. Blocking metadata43 addresses by string match is not a control: alternate encodings, IPv6, redirects and rebinding44 all walk past it.456. **Deserialization and object binding.** Untrusted bytes reaching a language's native46 deserializer, a YAML loader that constructs arbitrary types, or JSON that names its own class,47 is remote code execution waiting for a gadget. Alongside it: mass assignment binding a whole48 request body onto a model (`isAdmin` arrives free), and merge helpers in JavaScript that let a49 body reach the prototype chain.507. **Sessions and tokens.** Where is a session created, rotated on privilege change, and51 invalidated on logout and password change? Cookie flags set? Password-reset tokens random,52 single-use and short-lived? For signed tokens, check that verification pins the algorithm and53 the key and checks expiry and audience — accepting whatever algorithm the token names is the54 classic hole.558. **Secrets and inadvertent disclosure.** Keys committed to the repository or baked into a client56 bundle by a public-prefixed environment variable, tokens in URLs and logs, stack traces and57 debug routes reachable in production, error messages distinguishing "no such user" from "wrong58 password" where that matters.599. **File handling.** Path traversal in download and upload names, archive extraction writing60 outside its target directory, trusting a client-declared content type, and serving user files61 from the application's origin where they inherit its cookies and permissions.6210. **Dependencies: audit output is leads, not findings.** Run the ecosystem's audit, then check63 whether the vulnerable code path is actually reachable from step 1's entry points. Reporting an64 advisory list as a security review is how real findings get ignored.6511. **Confirm reachability before reporting.** Source, sink, and a path between them that survives66 the checks in between. Without that path, report it as hardening and label it so.6768**Sending payloads at a running system is a different act from reading code.** It stops and asks69first, names the target, and does not happen against production or anything the user has not said70they own. Reading is always in scope; probing is not implied by it.7172## Checklist7374- [ ] Entry points enumerated before any class was checked75- [ ] Access control checked per handler, including bulk endpoints and new-route defaults76- [ ] Every interpreter boundary found and checked for parameterization77- [ ] Output sinks checked per context, including uploads served from the app origin78- [ ] Every server-side fetch of a user-influenced URL identified79- [ ] Deserializers, model binding and merge helpers traced back to untrusted input80- [ ] Session lifecycle and token verification read, not assumed81- [ ] Repository, logs, bundles and error paths checked for secrets and disclosure82- [ ] File name, archive and content-type handling checked83- [ ] Dependency advisories triaged for reachability84- [ ] Each reported item has a source, a sink and a path; hardening labelled as hardening85- [ ] Nothing was probed against a live system without asking8687## Failure handling8889- **The pattern appears but the input turns out to be trusted** — drop it or downgrade it to90 hardening. A false positive costs more than a missed low-severity issue: it teaches the reader to91 skim.92- **A framework may already neutralise it** — check the framework's actual behaviour for that93 version rather than assuming either way, and say which behaviour you relied on.94- **The sink is reached through code you cannot follow** (dynamic dispatch, generated code, a95 vendored blob) — report it as an unresolved path with what you traced, not as safe.96- **A class cannot be checked at all** — no access to the templates, the infra config, the97 dependency lockfile — name it as unchecked in the report. Silence reads as a pass.98- **Something looks exploitable** — that is a hypothesis until it is run by someone authorized to99 run it. Write it as "reachable by inspection", not "exploitable".100101## Evidence to report102103Per finding: file and line, the untrusted input, the sink, the path between them, the concrete104consequence to a named asset, and the smallest fix. Per review: which entry points were105enumerated, which classes were checked, which were not checked and why, audit output with its106reachability triage, and everything reasoned about but not run, said so plainly.