[release-4.15] OCPBUGS-86712: Strip X-SSL-* headers for plain HTTP#806
[release-4.15] OCPBUGS-86712: Strip X-SSL-* headers for plain HTTP#806MrSanketkumar wants to merge 1 commit into
Conversation
|
@MrSanketkumar: This pull request references Jira Issue OCPBUGS-86712, 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. |
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe HAProxy config template gains a ChangesmTLS Header Stripping Across All Frontends
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors)
✅ Passed checks (13 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.
|
|
@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 247-260: The mutual TLS header filter guard in
haproxy-config.template currently defaults malformed
ROUTER_MUTUAL_TLS_HEADER_FILTER values to false, which can unintentionally
disable the delete-header rules. Update the shared conditional used around the
HAProxy http-request del-header block so invalid or unparseable values fail
closed by treating them as enabled or by rejecting the config, and apply the
same fix consistently to all three duplicated HAProxy blocks that use this
guard.
🪄 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: cc196d98-e206-4d12-b3b0-cdcb06806808
📒 Files selected for processing (1)
images/router/haproxy/conf/haproxy-config.template
| {{- 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
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Find the isTrue helper implementation =="
rg -n -C3 'func\s+isTrue\b|isTrue\s*[:=]|template\.FuncMap|sprig' .
echo
echo "== Find all uses of ROUTER_MUTUAL_TLS_HEADER_FILTER =="
rg -n -C2 'ROUTER_MUTUAL_TLS_HEADER_FILTER' .
echo
echo "== Find nearby uses of isTrue in templates for comparison =="
rg -n -C2 'isTrue \(env ' images/routerRepository: openshift/router
Length of output: 19116
Fail closed on invalid ROUTER_MUTUAL_TLS_HEADER_FILTER values
Any malformed value here evaluates to false, so a typo disables the header filter and reopens header spoofing. Reject invalid config or treat parse errors as enabled; the same guard is duplicated in all three HAProxy blocks.
🤖 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 247 - 260,
The mutual TLS header filter guard in haproxy-config.template currently defaults
malformed ROUTER_MUTUAL_TLS_HEADER_FILTER values to false, which can
unintentionally disable the delete-header rules. Update the shared conditional
used around the HAProxy http-request del-header block so invalid or unparseable
values fail closed by treating them as enabled or by rejecting the config, and
apply the same fix consistently to all three duplicated HAProxy blocks that use
this guard.
|
@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 : #805
Summary by CodeRabbit