← 返回列表

CVE-2021-25748

单站 Kubernetes Vulnerability Announcements 发布 Fri, 10 Jun 2022 16:01:41 +0000 入库 2026-11-18T06:56:48

Repository navigation

area/security

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

on Jun 10, 2022

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

  1. cjcullenadded kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.on Jun 10, 2022
  2. 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
  3. 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 the triage/accepted label and provide further guidance.
    The triage/accepted label can be added by org members by writing /triage accepted in 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.

  1. 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
  2. cjcullenchanged the title ~~[-]PLACEHOLDER[/-]~~ [+]CVE-2021-25748: Ingress-nginx `path` sanitization can be bypassed with newline character[/+] on Jun 10, 2022
  3. cjcullen commentedon Jun 10, 2022 MemberAuthorMore actions Fixed by kubernetes/ingress-nginx#8623

  4. cjcullenclosed this as completedon Jun 10, 2022
  5. 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
  6. bmv126 commentedon Jun 15, 2022 More actions @rikatz / @longwuyuan


    Any input on above comment ?
  7. 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.

  8. 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

  9. cji commentedon Aug 20, 2024 MemberMore actions /transfer kubernetes

  10. 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
  11. k8s-ci-robottransferred this issue fromkubernetes/ingress-nginxon Aug 20, 2024
  12. cji commentedon Aug 20, 2024 MemberMore actions /area security


    /kind bug
    /committee security-response
    /triage accepted
    /lifecycle frozen
    /label official-cve-feed
  13. 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

area/security

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.

原文链接:https://github.com/kubernetes/kubernetes/issues/126814