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

Your re-encryption endpoint will re-key any ciphertext

Role authorization passes, then the endpoint re-encrypts whatever key you send it. It never checks the key is yours, so an authorized user can re-target ciphertext they don't own.

authorized callersubmits…role check passesno ownership orcontext bindingservicere-encrypts…caller obtains are-targeted keyATTACKER INPUTIMPACTused as an oracle
Attack path · authorized caller submits a ciphertext key → role check passes → no ownership or context binding → service re-encrypts the key → caller obtains a re-targeted key

Role authorization passes, then the endpoint re-encrypts whatever key you send it. It never checks the key is yours, so an authorized user can re-target ciphertext they don't own.

What goes wrong

Holding a role is not the same as owning the object. This endpoint checks that the caller has an allowed role, then re-encrypts whatever encrypted key they pass in. It never binds that key to an owner or the tenant it belongs to. So a caller with the role can feed in a key that belongs to someone else and get it re-encrypted toward a target they choose.

A re-encryption primitive is a machine for changing who can read a key. Point it at material you do not control and you can move that access to yourself or a third party. The authorization here was written at the wrong layer. It gates the function, not the data. Every crypto operation that acts on caller-supplied ciphertext has to answer "is this yours" before it runs.

The pattern

Vulnerable
@RequireRole("key-user")
function reEncrypt(encryptedKey, target):
    // role check has passed
    // caller-supplied ciphertext, no owner check
    // no tenant or purpose binding
    return crypto.reEncrypt(encryptedKey, target)
Hardened
@RequireRole("key-user")
function reEncrypt(keyRef, target):
    key = store.load(keyRef)
    if (key.owner != caller.tenant):
        return FORBIDDEN
    if (!policy.allowsTarget(key, target)):
        return FORBIDDEN
    return crypto.reEncrypt(key.ciphertext, target)
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

Multi-tenant crypto services live or die on data-level authorization. A role check tells you the caller may use the feature. It says nothing about whether this specific key is theirs. If one role spans many tenants, a single authorized account becomes a way to re-key everyone's material. Bind every operation to the owning tenant and the intended purpose, or the feature is an oracle.

Check your own code