# CVE-2026-22822: External Secrets Operator insecurely retrieves secrets through the getSecretKey templating function

> Attackers can bypass namespace isolation to read secrets from other namespaces using the getSecretKey template function in External Secrets Operator.

- **Severity:** Critical 9.3 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Jan 2026
- **Updated:** 15 Jul 2026
- **Also known as:** GHSA-77v3-r3jw-j2v2, GO-2026-4330, MINI-gw6m-9vh7-f9qw

## What is CVE-2026-22822?

CVE-2026-22822 is a critical missing authorization vulnerability in external-secrets, published on 21 Jan 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

External Secrets Operator reads information from a third-party service and automatically injects the values as Kubernetes Secrets.  Starting in version 0.20.2 and prior to version 1.2.0, the `getSecretKey` template function, while introduced for senhasegura Devops Secrets Management (DSM) provider, has the ability to fetch secrets cross-namespaces with the roleBinding of the external-secrets controller, bypassing our security mechanisms. This function was completely removed in version 1.2.0, as everything done with that templating function can be done in a different way while respecting External Secrets Operator's safeguards As a workaround, use a policy engine such as Kubernetes, Kyverno, Kubewarden, or OPA to prevent the usage of `getSecretKey` in any ExternalSecret resource.

Weakness: CWE-863 (Incorrect Authorization)

## Which versions are affected by CVE-2026-22822?

3 open source packages ship an affected version, including github.com/external-secrets/external-secrets. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/external-secrets/external-secrets` | Go | From 0.20.2 | 1.2.0 |
| `github.com/external-secrets/external-secrets` | Go | From 0.20.2 | 1.2.0 |
| `github.com/external-secrets/external-secrets` | Go | From 0.20.2 | 1.2.0 |

Products: External-Secrets External Secrets Operator.

## How do I fix CVE-2026-22822?

Upgrade github.com/external-secrets/external-secrets to 1.2.0 or later.

## Is CVE-2026-22822 being exploited?

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

## Other vulnerabilities in external-secrets

- [CVE-2024-36540](https://insights.sbomify.com/CVE-2024-36540/): Missing authorization in n/a (critical 9.8)
- [CVE-2024-45041](https://insights.sbomify.com/CVE-2024-45041/): External Secrets Operator vulnerable to privilege escalation (high 8.3)
- [CVE-2026-34984](https://insights.sbomify.com/CVE-2026-34984/): External Secrets Operator has DNS exfiltration via getHostByName in its v2 template engine (high 7.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-22822 and fix it if it is affected.

What it is: CVE-2026-22822 is a critical missing authorization vulnerability in external-secrets, published on 21 Jan 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-22822 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/external-secrets/external-secrets (Go): affected from 0.20.2; fixed in 1.2.0
- github.com/external-secrets/external-secrets (Go): affected from 0.20.2; fixed in 1.2.0
- github.com/external-secrets/external-secrets (Go): affected from 0.20.2; fixed in 1.2.0

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-2026-22822/ (Markdown: https://insights.sbomify.com/CVE-2026-22822/index.md)
```

## Sources

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

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