Blog / A01:2021 Broken Access Control
A01:2021 · Broken Access Control

Passing the role check let you edit another's trust

An upload endpoint takes certificate bytes and a destination, then updates trust material for that destination. It checks your role, not whether the destination is yours.

Caller uploadscertificate…Controller checksthe caller's…Service updatestrust…No check ties thetarget to…Trust for anotherdomain…ATTACKER INPUTIMPACTcheck absent
Attack path · Caller uploads certificate content and a target domain → Controller checks the caller's role only → Service updates trust material for the named target → No check ties the target to the caller → Trust for another domain is installed or replaced

An upload endpoint takes certificate bytes and a destination, then updates trust material for that destination. It checks your role, not whether the destination is yours.

What goes wrong

An endpoint accepts certificate content and an identifier for where it should go, then calls an operation that installs or replaces trust material for that target. The controller authorizes the caller by role. That is the entire access decision.

The target identifier comes from the request. Nothing checks that the caller is allowed to modify trust for that specific domain, so a user with the right role can name a domain that is not theirs and push certificate material into its trust configuration. Whoever relies on that trust store now trusts whatever the attacker uploaded.

Role says the caller is allowed to do this kind of thing. It does not say they are allowed to do it to this object. When the object is trust material for an arbitrary domain, the distance between those two statements is the whole vulnerability.

The pattern

Vulnerable
@RequireRole('cert-admin')
def putDomainTrust(req):
    domain = req.targetDomain      # caller names the target
    cert = req.certBytes
    trustStore.update(domain, cert)   # no owner check
    return ok()
Hardened
@RequireRole('cert-admin')
def putDomainTrust(req):
    domain = req.targetDomain
    if not caller.managesDomain(domain):   # object-level check
        deny()
    cert = parseAndValidate(req.certBytes)
    trustStore.update(domain, cert)
    audit(caller, 'trust-update', domain)
How the pipeline adjudicated itHELD
ABCDEFGH

Grounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.

Ed25519 · per-tenant signing key · gate ledger A–H · verify offline against the published payload hash

Why it matters to you

Trust material is a high-value target because it changes what your systems believe. Overwrite the wrong trust anchor and you can enable interception or the silent acceptance of forged certificates for a domain the attacker had no business touching. One role, granted a little too broadly, becomes cross-domain control.

Role checks scale poorly to resource ownership. Every endpoint that acts on a caller-named object needs a second decision: is this caller allowed to act on this object? Put that check in the service, close to the write, where it cannot be skipped.

Check your own code