[release-4.16] OCPBUGS-86713: Strip X-SSL-* headers for plain HTTP#805
[release-4.16] OCPBUGS-86713: Strip X-SSL-* headers for plain HTTP#805MrSanketkumar wants to merge 1 commit into
Conversation
|
@MrSanketkumar: This pull request references Jira Issue OCPBUGS-86713, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThe HAProxy configuration template adds a conditional block to all three frontends ( ChangesX-SSL Header Spoofing Prevention
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@images/router/haproxy/conf/haproxy-config.template`:
- Around line 244-259: The HAProxy header-scrubbing blocks in
haproxy-config.template omit X-SSL-Client-Cert, leaving it spoofable even though
downstream code relies on it. Update every mutual-TLS header filter block in the
template to also delete X-SSL-Client-Cert alongside the other X-SSL-Client-*
headers, so the router’s mTLS identity hardening is consistent across all
listeners.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2bb05804-187f-4b8d-a5ef-89999e386aba
📒 Files selected for processing (1)
images/router/haproxy/conf/haproxy-config.template
| # Strip off X-SSL* headers for plain HTTP if not explicitly disabled. | ||
| # This prevents unauthenticated spoofing of mutual TLS client identities. | ||
| {{- if isTrue (env "ROUTER_MUTUAL_TLS_HEADER_FILTER" "true") }} | ||
| http-request del-header X-SSL | ||
| http-request del-header X-SSL-Client-CN | ||
| http-request del-header X-SSL-Client-DER | ||
| http-request del-header X-SSL-Client-DN | ||
| http-request del-header X-SSL-Client-NotAfter | ||
| http-request del-header X-SSL-Client-NotBefore | ||
| http-request del-header X-SSL-Client-SHA1 | ||
| http-request del-header X-SSL-Client-Serial | ||
| http-request del-header X-SSL-Client-Subject | ||
| http-request del-header X-SSL-Client-Verify | ||
| http-request del-header X-SSL-Client-Version | ||
| http-request del-header X-SSL-Issuer | ||
| {{- end }} |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
X-SSL-Client-Cert is still spoofable.
These blocks claim to strip X-SSL-Client-* headers, but they omit X-SSL-Client-Cert. That header is already used downstream (pkg/router/router_test.go, Line 479 onward), so a client can still inject it and bypass the intended mTLS identity hardening for backends that trust it.
Suggested fix
http-request del-header X-SSL-Client-CN
+ http-request del-header X-SSL-Client-Cert
http-request del-header X-SSL-Client-DERAlso applies to: 378-394, 511-527
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@images/router/haproxy/conf/haproxy-config.template` around lines 244 - 259,
The HAProxy header-scrubbing blocks in haproxy-config.template omit
X-SSL-Client-Cert, leaving it spoofable even though downstream code relies on
it. Update every mutual-TLS header filter block in the template to also delete
X-SSL-Client-Cert alongside the other X-SSL-Client-* headers, so the router’s
mTLS identity hardening is consistent across all listeners.
|
@MrSanketkumar: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Vulnerability: CVE-2026-46579 - mTLS client certificate spoofing via HTTP header injection
Fix: Prevents unauthenticated spoofing of mutual TLS client identities by stripping X-SSL-Client-* headers from HTTP requests before they reach backends.
Changes:
Backport : #804
Summary by CodeRabbit
X-SSLand related client identity headers on supported traffic paths unless explicitly allowed.Content-Lengthrequests and removing theProxyheader.