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

A decrypt endpoint that returns anyone's plaintext

Send it ciphertext, it sends back plaintext. The role check passes and nothing verifies the data is yours, so one allowed account can read another context's secrets.

authorized callersubmits…role check passesno ownership orcontext checkservice decryptsthe inputplaintextreturned to…ATTACKER INPUTIMPACTused as an oracle
Attack path · authorized caller submits ciphertext → role check passes → no ownership or context check → service decrypts the input → plaintext returned to the caller

Send it ciphertext, it sends back plaintext. The role check passes and nothing verifies the data is yours, so one allowed account can read another context's secrets.

What goes wrong

This is a decryption oracle wearing an authorization badge. The endpoint takes encrypted attributes from the caller, decrypts them, and returns the plaintext. There is a role check, and that is the whole gate. Nothing confirms the ciphertext belongs to the caller's tenant or was encrypted for their context.

Collect ciphertext from anywhere in the system, a log line or another tenant's record, and hand it to this endpoint. If you hold the role, you get the cleartext back. The crypto is doing exactly what it was told. The mistake is treating "can call decrypt" as "may read this particular secret." Those are different questions, and only one of them is being asked.

The pattern

Vulnerable
@RequireRole("reader")
function decrypt(encryptedAttributes):
    // role is the only gate
    // ciphertext accepted from the caller
    // no ownership or tenant check
    return cryptoService.decrypt(encryptedAttributes)
Hardened
@RequireRole("reader")
function decrypt(recordId):
    record = store.load(recordId)
    if (record.tenant != caller.tenant):
        return FORBIDDEN
    if (!record.readableBy(caller)):
        return FORBIDDEN
    return cryptoService.decrypt(record.ciphertext)
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

Any endpoint that turns ciphertext into plaintext is a target. If it accepts arbitrary input and checks only a role, it will decrypt data the caller was never meant to see the moment they get the bytes. In a multi-tenant system that is a cross-tenant read. Authorize the record, not the operation, and stop accepting loose ciphertext when a reference to owned data does the job.

Check your own code