PST-069: A client-supplied X-Request-ID is accepted verbatim and echoed, so a stranger can borrow another request's id in the logs #798
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#798
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the security audit of 2026-10-10 (
SECURITY-AUDIT-2026-10-10.md), run againstmainatc30851bfrom 8 to 10 October 2026, as PST-069. Severity: Informational.The text below is the audit's entry, unchanged apart from links to the other issues it names. The finding was produced by automated review and checked by a second automated pass; re-check it before acting on it.
src/postulo/core/middleware.py(216-225)Who can do it, and what they need. Any client; no precondition. A reverse proxy that generates its own id but does not overwrite an incoming one passes the client's value through.
How it works.
X-Request-ID: <id of a request they want to muddy or claim>.[A-Za-z0-9._:-]{1,200}and binds it to every log line of the request, then echoes it.GET /healthzwithX-Request-ID: spoofed-id-of-another-requestwas answered with that same id.Impact. Confuses incident forensics; no injection (newlines and other characters are refused) and no data exposure.
Verification (verdict: confirmed; severity after verification: Informational). No correction to file or line. Precondition clarified: to muddy a specific other request's log lines the attacker must know that request's id, which is a random 32-hex uuid4 or the proxy's own; without that, the only effect is that a client's own lines carry an id it chose, which is the feature. Remediation: document that a reverse proxy in front should overwrite X-Request-ID (or make honouring an inbound id conditional on the request arriving from a trusted proxy address, which TrustedProxyMiddleware already identifies).
Suggested remediation. Accept an incoming id only from a trusted proxy peer (reuse
proxy.is_trusted/POSTULO_PROXY_ADDR) and mint a fresh one otherwise, or append a server-side suffix so the two are distinguishable.Fixed in
0ca79b4a8on main.X-Request-IDis dropped #976