# CVE-2024-7646: Command injection in ingress-nginx

> Attackers with Ingress creation permissions can inject commands to steal controller credentials, exposing all cluster secrets.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 16 Aug 2024
- **Updated:** 19 Aug 2024
- **Also known as:** GHSA-qx8j-xj5q-v7r3, GO-2024-3075

## What is CVE-2024-7646?

CVE-2024-7646 is a high-severity command injection vulnerability in Kubernetes ingress-nginx, published on 16 Aug 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

A security issue was discovered in ingress-nginx where an actor with permission to create Ingress objects (in the `networking.k8s.io` or `extensions` API group) can bypass annotation validation to inject arbitrary commands and obtain the credentials of the ingress-nginx controller. In the default configuration, that credential has access to all secrets in the cluster.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2024-7646?

1 open source package ship an affected version, including github.com/kubernetes/ingress-nginx.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/kubernetes/ingress-nginx` | Go | All versions | None |

## How do I fix CVE-2024-7646?

No fix has been published for CVE-2024-7646 yet. Limit exposure of the affected software until one is available.

## Is CVE-2024-7646 being exploited?

There is no known exploitation of CVE-2024-7646 in the wild and no public exploit code.

Public exploit code:

- PoC CVE-2024-7646 (github_poc): https://github.com/dovics/cve-2024-7646
- PoC CVE-2024-7646 (github_poc): https://github.com/r0binak/CVE-2024-7646

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-7646 and fix it if it is affected.

What it is: CVE-2024-7646 is a high-severity command injection vulnerability in Kubernetes ingress-nginx, published on 16 Aug 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-7646 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/kubernetes/ingress-nginx (Go): affected all versions; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-7646/ (Markdown: https://insights.sbomify.com/CVE-2024-7646/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-7646
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-7646
- OSV: https://osv.dev/vulnerability/CVE-2024-7646

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-7646/
Summaries are generated and may contain mistakes; the official description above is the record.
