Skip to content

OCPBUGS-74945: Adding escapeHAProxySingleQuotes for sanitize [release-4.13]#783

Open
Thealisyed wants to merge 1 commit into
openshift:release-4.13from
Thealisyed:release413-cvefix
Open

OCPBUGS-74945: Adding escapeHAProxySingleQuotes for sanitize [release-4.13]#783
Thealisyed wants to merge 1 commit into
openshift:release-4.13from
Thealisyed:release413-cvefix

Conversation

@Thealisyed

Copy link
Copy Markdown
Contributor

This function will allow users to include
certain characters and spacing to avoid
any config injection

Adapted router_test.go to use mustCreate struct (mustCreateRoute does not exist on this branch).

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jun 3, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@Thealisyed: This pull request references Jira Issue OCPBUGS-74945, which is invalid:

  • expected dependent Jira Issue OCPBUGS-74947 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This function will allow users to include
certain characters and spacing to avoid
any config injection

Adapted router_test.go to use mustCreate struct (mustCreateRoute does not exist on this branch).

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.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5e848b24-9b86-47e3-8126-1f6bcf35076f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from alebedev87 and frobware June 3, 2026 10:44
@Miciah

Miciah commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

/approve

This is a risky backport that could break routes that use special characters such as backslashes in spec.path.

/label backport-risk-assessed

@Thealisyed, could you reverse the order of the commits, or squash them, so that the first commit doesn't cause make check to fail?

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Jun 3, 2026
@openshift-ci

openshift-ci Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Miciah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 3, 2026
@bentito

bentito commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

/assign @jcmoraisjr

This function will allow users to include
certain characters and spacing to avoid
any config injection
@Thealisyed Thealisyed force-pushed the release413-cvefix branch from d17d7ec to 5e96c97 Compare June 4, 2026 10:05
@Thealisyed

Copy link
Copy Markdown
Contributor Author

infra issue

/retest

@Thealisyed

Copy link
Copy Markdown
Contributor Author

Prow's blobless clone failed with Could not resolve host: github.com during lazy blob fetch after merge. Unrelated to code changes (same diff passes on #782 and #785)

@rhamini3

rhamini3 commented Jun 5, 2026

Copy link
Copy Markdown

Tested on a 4.13 cluster

% oc annotate route edg-route haproxy.router.openshift.io/rewrite-target="/it's" --overwrite
route.route.openshift.io/edg-route annotated
% oc get route edg-route -o yaml 
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  annotations:
    haproxy.router.openshift.io/rewrite-target: /it's
    openshift.io/host.generated: "true"
% oc -n openshift-ingress rsh router-default-654f74c94c-46lxr
sh-4.4$ cat haproxy.config | grep edg-route -A20
backend be_edge_http:default:edg-route
  mode http
  option redispatch
  option forwardfor
  balance random

  timeout check 5000ms
  http-request add-header X-Forwarded-Host %[req.hdr(host)]
  http-request add-header X-Forwarded-Port %[dst_port]
  http-request add-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request add-header X-Forwarded-Proto https if { ssl_fc }
  http-request add-header X-Forwarded-Proto-Version h2 if { ssl_fc_alpn -i h2 }
  http-request add-header Forwarded for=%[src];host=%[req.hdr(host)];proto=%[req.hdr(X-Forwarded-Proto)]
  # Path rewrite target
  http-request replace-path '^(.*)$' '/its\1'
  cookie 52eb704682406c0b9dc7ca0797a30db9 insert indirect nocache httponly secure attr SameSite=None

haproxy shows the single quotes as expected
/verified by @rhamini3

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 5, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@rhamini3: This PR has been marked as verified by @rhamini3.

Details

In response to this:

Tested on a 4.13 cluster

% oc annotate route edg-route haproxy.router.openshift.io/rewrite-target="/it's" --overwrite
route.route.openshift.io/edg-route annotated
% oc get route edg-route -o yaml 
apiVersion: route.openshift.io/v1
kind: Route
metadata:
 annotations:
   haproxy.router.openshift.io/rewrite-target: /it's
   openshift.io/host.generated: "true"
% oc -n openshift-ingress rsh router-default-654f74c94c-46lxr
sh-4.4$ cat haproxy.config | grep edg-route -A20
backend be_edge_http:default:edg-route
 mode http
 option redispatch
 option forwardfor
 balance random

 timeout check 5000ms
 http-request add-header X-Forwarded-Host %[req.hdr(host)]
 http-request add-header X-Forwarded-Port %[dst_port]
 http-request add-header X-Forwarded-Proto http if !{ ssl_fc }
 http-request add-header X-Forwarded-Proto https if { ssl_fc }
 http-request add-header X-Forwarded-Proto-Version h2 if { ssl_fc_alpn -i h2 }
 http-request add-header Forwarded for=%[src];host=%[req.hdr(host)];proto=%[req.hdr(X-Forwarded-Proto)]
 # Path rewrite target
 http-request replace-path '^(.*)$' '/its\1'
 cookie 52eb704682406c0b9dc7ca0797a30db9 insert indirect nocache httponly secure attr SameSite=None

haproxy shows the single quotes as expected
/verified by @rhamini3

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.

@melvinjoseph86

Copy link
Copy Markdown

/retest-required

@openshift-ci

openshift-ci Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

@Thealisyed: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-serial 5e96c97 link true /test e2e-aws-serial

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@Thealisyed

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@Thealisyed: This pull request references Jira Issue OCPBUGS-74945, which is invalid:

  • expected dependent Jira Issue OCPBUGS-74947 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@melvinjoseph86

Copy link
Copy Markdown

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jun 8, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@melvinjoseph86: This pull request references Jira Issue OCPBUGS-74945, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.13.z) matches configured target version for branch (4.13.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-74947 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-74947 targets the "4.14.z" version, which is one of the valid target versions: 4.14.0, 4.14.z
  • bug has dependents

No GitHub users were found matching the public email listed for the QA contact in Jira (ocp-sustaining-admins@redhat.com), skipping review request.

Details

In response to this:

/jira refresh

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants