APIparsevalidateauthorizeprocess

Parse, Validate, Authorize, Process

Validation answers “is this value well-formed and meaningful?”; authorization separately answers “may this principal perform this action?”

▶ Run the labFollow the failure

Frame the problem

Security starts with a concrete asset, attacker capability and trust crossing.

Asset
Application invariants and every interpreter reached downstream.
Attacker & capability
A caller who controls request paths, headers and bodies.
Trust boundary
Untrusted request → typed application data
AssetThreatAttack SurfaceTrust BoundaryVulnerabilityExploit PathImpactMitigationDefense in DepthResidual Risk

Why the system fails

The program uses data before parsing it, validates only shape, or mistakes sanitization for authorization.

The important question is not “what is Parse, Validate, Authorize, Process?” but “which assumption let untrusted data or an over-scoped identity cross untrusted request → typed application data?” Trace the decision at the boundary, then constrain what can happen after the first control fails.

Design the control in layers

Start with the control closest to the interpretation or privilege boundary: Parse into an explicit schema before use Then add a control that reduces blast radius and telemetry that proves the decision was enforced.

The resulting design is not labelled secure. Record the identified controls, the known failure paths, the remaining exposure, and the evidence you would need during an incident.

PreventDetectRecover
Parse into an explicit schema before use · Validate ranges, relationships and business semantics · Authorize the operation after identifying the resourceStructured validation failures by field and callerContain the affected identity or component, scope impact from audit evidence, and preserve a regression test.

Key points

  • Asset: Application invariants and every interpreter reached downstream.
  • Boundary: Untrusted request → typed application data
  • Primary control: Parse into an explicit schema before use
  • Detection signal: Structured validation failures by field and caller
  • Always ask what limits damage when the primary control fails.

Boundary control exercise

This lesson uses the shared boundary-control exercise.

Boundary control check
Untrusted input / identity
Trust boundary
Privileged asset
Prevention may fail silently.

Follow the attack

Safe conceptual simulation: capability → missing control → crossed boundary → asset impact.

  1. 1
    Attacker starts with: A caller who controls request paths, headers and bodies.
  2. 2
    The program uses data before parsing it, validates only shape, or mistakes sanitization for authorization.
  3. 3
    The weak or missing boundary control is crossed: Untrusted request → typed application data
  4. 4
    Impact: Corrupted state, injection, resource exhaustion or unauthorized operations.
Blast radius
  • Corrupted state, injection, resource exhaustion or unauthorized operations.

Defend, detect, recover

One prevention is a single point of security failure. Layer it and make failure observable.

Prevent
  • • Parse into an explicit schema before use
  • • Validate ranges, relationships and business semantics
  • • Authorize the operation after identifying the resource
Detect
  • • Structured validation failures by field and caller
Respond & recover
  • • Contain the affected identity or component.
  • • Scope access from audit evidence.
  • • Fix the boundary and add a regression test.
Residual risk
  • • Misconfiguration and new access paths can bypass the intended control.
  • • A privileged insider or compromised control plane may still reach the asset.

Misconceptions

Claim
“A single parse into an explicit schema before use control makes this safe.”
Reality
One control changes risk; it does not erase it. Design prevention, detection, recovery, and blast-radius limits together.