Repository navigation
committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
needs-priorityIndicates a PR lacks a `priority/foo` label and requires one.Indicates a PR lacks a `priority/foo` label and requires one.
official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)
triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
Issue Details
A security issue was discovered in ingress-nginx where a user that can create or update ingress objects can use a newline character to bypass the sanitization of the spec.rules[].http.paths[].path field of an Ingress object (in the networking.k8s.io or extensions API group) to obtain the credentials of the ingress-nginx controller. In the default configuration, that credential has access to all secrets in the cluster.
This issue has been rated High (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L), and assigned CVE-2021-25748.
Affected Components and Configurations
This bug affects ingress-nginx. If you do not have ingress-nginx installed on your cluster, you are not affected. You can check this by running kubectl get po -n ingress-nginx.
If you are running the “chrooted” ingress-nginx controller introduced in v1.2.0 (gcr.io/k8s-staging-ingress-nginx/controller-chroot), you are not affected.
Multitenant environments where non-admin users have permissions to create Ingress objects are most affected by this issue.
Affected Versions
\<v1.2.1
Fixed Versions
v1.2.1
Mitigation
If you are unable to roll out the fix, this vulnerability can be mitigated by implementing an admission policy that restricts the spec.rules[].http.paths[].path field on the networking.k8s.io/Ingress resource to known safe characters (see the newly added rules, or the suggested value for annotation-value-word-blocklist).
Detection
If you find evidence that this vulnerability has been exploited, please contact security@kubernetes.io
Additional Details
See ingress-nginx Issue #8686 for more details.
Acknowledgements
This vulnerability was reported by Gafnit Amiga.
Thank You,
CJ Cullen on behalf of the Kubernetes Security Response Committee
Activity
- cjcullenadded kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.on Jun 10, 2022
- k8s-ci-robotadded needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.on Jun 10, 2022
-
k8s-ci-robot commentedon Jun 10, 2022 ContributorMore actions @cjcullen: This issue is currently awaiting triage.
If Ingress contributors determines this is a relevant issue, they will accept it by applying thetriage/acceptedlabel and provide further guidance.
Thetriage/acceptedlabel can be added by org members by writing/triage acceptedin a comment.
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/test-infra repository.
- k8s-ci-robotadded needs-priorityIndicates a PR lacks a `priority/foo` label and requires one.Indicates a PR lacks a `priority/foo` label and requires one.on Jun 10, 2022
- cjcullenchanged the title ~~[-]PLACEHOLDER[/-]~~ [+]CVE-2021-25748: Ingress-nginx `path` sanitization can be bypassed with newline character[/+] on Jun 10, 2022
-
cjcullen commentedon Jun 10, 2022 MemberAuthorMore actions Fixed by kubernetes/ingress-nginx#8623
- cjcullenclosed this as completedon Jun 10, 2022
-
stefanlasiewski commentedon Jun 14, 2022 More actions or the suggested value for annotation-value-word-blocklist
For clarification, @cjcullen or someone else, can you explain how the suggested value in the documentation prevents this? The suggested value is as follows-- what part prevents a newline character?
suggested: "load_module,lua_package,_by_lua,location,root,proxy_pass,serviceaccount,{,},',"" Reacted by bmv126 -
bmv126 commentedon Jun 15, 2022 More actions @rikatz / @longwuyuan
Any input on above comment ? -
rikatz commentedon Jun 15, 2022 MemberMore actions We patched the nginx and dropped the directives that could be used for this instead of relying on the regex :) also if someone realizes there are missing points in regex and wanna help, please please open a PR and mark me improving that regex.
-
stefanlasiewski commentedon Jun 15, 2022 More actions I'm willing to write a PR for this, but I don't know how to replicate the bug and I don't know what log messages to look for. (I was trying last night) Reacted by mackenziesmith528
-
cji commentedon Aug 20, 2024 MemberMore actions /transfer kubernetes
- k8s-ci-robotadded needs-sigIndicates an issue or PR lacks a `sig/foo` label and requires one.Indicates an issue or PR lacks a `sig/foo` label and requires one.on Aug 20, 2024
- k8s-ci-robottransferred this issue fromkubernetes/ingress-nginxon Aug 20, 2024
-
cji commentedon Aug 20, 2024 MemberMore actions /area security
/kind bug
/committee security-response
/triage accepted
/lifecycle frozen
/label official-cve-feed - k8s-ci-robotadded lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC) and removed needs-sigIndicates an issue or PR lacks a `sig/foo` label and requires one.Indicates an issue or PR lacks a `sig/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.on Aug 20, 2024
Metadata
Metadata
Assignees
Labels
committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
needs-priorityIndicates a PR lacks a `priority/foo` label and requires one.Indicates a PR lacks a `priority/foo` label and requires one.
official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)
triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.