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
@GET("/rekey")
def rekey(request):
blob = request.query["material"] # lands in access logs
return reencrypt(blob)@POST("/rekey")
def rekey(request):
blob = request.body["material"] # not logged by default
return reencrypt(blob)
# and: scrub known-sensitive fields in the log formatterEvery gate held. The exploit path was reproduced against a negative control, the impact was calibrated, and the finding was signed report-ready.
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
- List every endpoint that reads security-sensitive input from query parameters.
- Move secrets and key material to request bodies or headers, never the URL.
- Confirm your log pipeline redacts sensitive fields and does not capture full request lines.