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

Requesting a certificate in someone else's name

The CSR endpoint takes the subject and the application it represents from the request, checks your role, and signs off. Name an identity that isn't yours and it obliges.

Caller submits aCSR request…Body names theapplication…Controller checksthe caller's…No check bindsthe identity…A CSR isgenerated…ATTACKER INPUTIMPACTcheck absent
Attack path · Caller submits a CSR request with subject details → Body names the application and subject identity → Controller checks the caller's role only → No check binds the identity to the caller → A CSR is generated for another application

The CSR endpoint takes the subject and the application it represents from the request, checks your role, and signs off. Name an identity that isn't yours and it obliges.

What goes wrong

A certificate signing request endpoint takes a request object from the body and generates a CSR from it. The object carries the application or reference identity and the subject fields that will end up in the certificate. The controller checks a role and passes the object straight through.

Since the caller fills in the identity, the caller can put someone else's there. A permitted role can request a CSR that represents an application or domain it has no claim to. Depending on what your certificate authority does next, that request can turn into a real certificate for an identity the requester should never be able to assert.

Authorizing the caller's role is not the same as authorizing the identity in the request. The CSR is a statement of 'I am this thing', and the endpoint is signing that statement without checking whether the caller is that thing.

The pattern

Vulnerable
@RequireRole('csr-user')
def generateCsr(req):
    subject = req.subject          # caller writes the identity
    appId = req.applicationId
    return csr.create(appId, subject)   # no identity binding
Hardened
@RequireRole('csr-user')
def generateCsr(req):
    appId = req.applicationId
    if not caller.owns(appId):
        deny()
    subject = subjectFor(appId)       # server sets the identity
    return csr.create(appId, subject) # caller cannot forge it
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 CSR that names an identity the requester does not control is a request to impersonate that identity in certificate form. If your issuing pipeline trusts the CSR's contents, the attacker walks away with a credential for another application or domain. Even when a human approves, a plausible-looking CSR is a good way to slip one past a tired reviewer.

Put the subject identity under server control. Derive it from the application the caller is proven to own, rather than copying it out of the request, and reject any CSR whose identity the caller cannot claim.

Check your own code