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

A null allowlist that quietly allows every field

Your template fills placeholders from a credential, gated by an allowlist. When the allowlist is null the gate is skipped, and a caller-picked pointer can pull the whole object into the output.

Caller supplies aplaceholder…Allowlist isnull, so…Selector resolvesto any…Full object isserialized…Sensitive fieldscome back to…ATTACKER INPUTIMPACTcheck absent
Attack path · Caller supplies a placeholder with a field selector → Allowlist is null, so the field check is skipped → Selector resolves to any field, including the root → Full object is serialized into the rendered output → Sensitive fields come back to the caller

Your template fills placeholders from a credential, gated by an allowlist. When the allowlist is null the gate is skipped, and a caller-picked pointer can pull the whole object into the output.

What goes wrong

A rendering step takes a template, finds placeholders, and swaps each one for a value pulled from the credential by a pointer. To keep that safe, there is an allowlist of fields a placeholder is allowed to reach. Sensible design.

The allowlist defaults to null. And when it is null, the check that consults it is skipped entirely, so every field is fair game. A caller who controls the placeholder can point at anything, including the empty pointer that selects the whole object, and watch it get serialized straight into the output. The same thing happens when the render definition simply has no allowlist attached.

This is the classic fail-open default. Absent configuration reads as permission rather than denial. The feature works in every test because the tests supply an allowlist. Production supplies attackers who do not.

The pattern

Vulnerable
def render(template, credential, allowlist):
    for ph in template.placeholders:
        if allowlist is not None:
            requireAllowed(ph.pointer, allowlist)
        value = credential.resolve(ph.pointer)  # any field
        template.replace(ph, serialize(value))
    return template
Hardened
def render(template, credential, allowlist):
    if not allowlist:
        raise Error('no fields permitted for rendering')
    for ph in template.placeholders:
        requireAllowed(ph.pointer, allowlist)   # always
        rejectRootPointer(ph.pointer)
        value = credential.resolve(ph.pointer)
        template.replace(ph, serialize(value))
    return template
How the pipeline adjudicated itPROVEN
ABCDEFGH

Every gate held. The exploit path was reproduced against a negative control, the impact was calibrated, and the finding was signed report-ready.

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

Why it matters to you

Fail-open defaults show up anywhere a config value can be missing. An empty allowlist should mean nothing is allowed, but too often it means the check gets skipped. The difference is whether a misconfiguration leaks data or just breaks the feature, and breaking the feature is the outcome you want.

Here the leak is the entire credential, handed back through a rendering path nobody thinks of as an API. Any code that resolves a caller-chosen pointer into serialized output deserves the suspicion you give a raw query endpoint.

Check your own code