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

A decrypt endpoint that returns plaintext to any role

Post a ciphertext, get back plaintext. The endpoint checks the caller's role and never checks whose ciphertext it is or what key should touch it.

Caller postsciphertext…Controller checksonly the…Values go to thehardware-backed…Plaintext isreturned to…Another context'ssecrets…ATTACKER INPUTIMPACTused as an oracle
Attack path · Caller posts ciphertext and decrypt parameters → Controller checks only the caller's role → Values go to the hardware-backed decrypt service → Plaintext is returned to the caller → Another context's secrets are exposed

Post a ciphertext, get back plaintext. The endpoint checks the caller's role and never checks whose ciphertext it is or what key should touch it.

What goes wrong

An endpoint takes ciphertext and decryption parameters from the request body, passes them to a hardware-backed key, and returns the plaintext. The only gate is a role. If you hold it, you can submit ciphertext you did not create and read what comes out.

Nothing ties the request to ownership, tenant, or the intended purpose of the key. The service will decrypt a blob captured from another user's traffic or another tenant's storage, as long as it was encrypted under a key this endpoint can reach. You have a general-purpose decryption oracle sitting behind a role check.

A decrypt operation is a capability, and role-based access controls who can invoke the capability, not what they are allowed to point it at. Those are different, and only the first is enforced.

The pattern

Vulnerable
@RequireRole('decryptor')
def decrypt(req):
    ct = req.ciphertext        # attacker-supplied blob
    params = req.params
    pt = hsm.decrypt(KEY_ID, ct, params)
    return { 'plaintext': pt }    # no context check at all
Hardened
@RequireRole('decryptor')
def decrypt(req):
    ref = lookupCiphertext(req.id)          # server-side handle
    requireOwnership(caller, ref.owner)     # caller's own data
    requireKeyPurpose(ref.keyId, 'user-data')
    pt = hsm.decrypt(ref.keyId, ref.ciphertext, ref.params)
    return { 'plaintext': pt }
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

A decryption oracle collapses your encryption at rest and in transit down to whoever can call this route. Secrets you assumed were protected because they were encrypted are readable on demand. If the same key protects multiple tenants or purposes, one endpoint undoes the separation you designed the key hierarchy to provide.

Do not accept raw ciphertext and decrypt it on trust. Reference stored ciphertext through a handle you control, verify the caller owns it, and scope keys by purpose so a single decrypt route cannot open everything.

Check your own code