Blog / A02:2021 Cryptographic Failures
A02:2021 · Cryptographic Failures

Secrets in the query string end up everywhere you did not expect

A re-encryption endpoint took ciphertext key material as a URL parameter. Query strings end up in access logs and browser history, so that value now lives in a dozen places you never audited.

client calls theendpointkey ciphertextpassed as a…value written toaccess logs…value persistsoutside…ciphertextexposed…ATTACKER INPUTIMPACTwritten to logs
Attack path · client calls the endpoint → key ciphertext passed as a query parameter → value written to access logs and telemetry → value persists outside the crypto boundary → ciphertext exposed and replayable

A re-encryption endpoint took ciphertext key material as a URL parameter. Query strings end up in access logs and browser history, so that value now lives in a dozen places you never audited.

What goes wrong

The endpoint takes encrypted key material and reads it from the query string. It works, and in a demo it looks fine, because the value is already encrypted. The trouble is where that URL goes after the request finishes.

Query strings are the least private part of an HTTP request. They land in web server access logs, in reverse proxy logs, in APM and monitoring tools, in browser history, and in any intermediary that records the request line. None of those systems treat the value as a secret, because they have no idea it is one. You have effectively broadcast the ciphertext to your entire observability stack, plus anyone with the history pane open.

Encrypted does not mean safe to spread. A recorded ciphertext can be replayed against the same endpoint, and its presence in logs widens the audience for any future weakness in the scheme. Sensitive material belongs in a request body or a header, over TLS, kept out of anything that gets written down.

The pattern

Vulnerable
@GET("/rekey")
def rekey(request):
    blob = request.query["material"]   # lands in access logs
    return reencrypt(blob)
Hardened
@POST("/rekey")
def rekey(request):
    blob = request.body["material"]    # not logged by default
    return reencrypt(blob)

# and: scrub known-sensitive fields in the log formatter
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

Your logs outlive your requests. Anything that reaches them is retained, shipped to a third-party log platform, and read by people who never needed to see it. If a value would be dangerous in a leaked log bundle, it should never travel in a URL. Cheap to fix now, an incident report later.

Check your own code