Repository navigation
Relay constant header names and CR/LF-stripped values (CodeQL #9, #10) - #163
Conversation
…ance proxy CodeQL still traced the relayed upstream name and value into send_header (#9/#10) even though validation refuses unsafe headers first. Relay the canonical name from the constant table and a value with CR and LF stripped after that validation, so the sink is recognisably sanitised. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Security exact-head source review at 55fb78c: source-clear. The header name reaching the sink is now selected from seven constant canonical literals. The value still passes the full fail-closed grammar first, then the explicit CR/LF removal expression is behavior-preserving defense in depth for CodeQL. The exact lowercase set remains pinned; the new self-consistency check binds every key to its canonical literal; all original arbitrary-field, request-only, invalid-name, CR/LF, C0, DEL, C1/8-bit and dropped-header refusal cases remain. Local 8/8 passes on this exact head. Merge gate: fresh Python CodeQL must finish successfully and the pull-request ref must have no open replacement response-splitting alert. After protected merge, require #9/#10 to transition to fixed automatically before closing #161. Do not dismiss them. |
|
Security scanner gate readback: Python CodeQL job 125896575357 succeeded on exact head 55fb78c, and refs/pull/163/head has zero open code-scanning alerts. The security-specific merge gate is satisfied. Merge only after the remaining fresh hosted checks are terminal green; then require protected-main #9/#10 automatic closure. |
|
|
Security protected-main acceptance:
The response-header security/scanner obligation is fully delivered; no residual hold remains. |



Follow-up to #162 per Security's correction (#162 comment 6602904638); reopened #161.
Protected-main CodeQL fixed #7/#8 but raised #9/#10 at the moved
send_headersink, because the relayed name and value still trace from the upstream response. Runtime validation already fails closed, so this is scanner-recognition debt, not exposure.FORWARDED_HEADERSis now a map from lowercase name to a constant canonical name, and the relayed name comes from that constant table.value.replace('\\r', '').replace('\\n', ''), applied after the existing refusal validation. That's a no-op for any value that passes validation, and it gives CodeQL a sanitiser it recognises.Security: please review the exact head. Refs #161.
🤖 Generated with Claude Code