CVE-2026-22822: External Secrets Operator insecurely retrieves secrets through the getSecretKey templating function
Summary
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, as everything done with that templating function can be done in a different way while respecting our safeguards (for example, using sourceRef like explained here: https://github.com/external-secrets/external-secrets/issues/5690#issuecomment-3630977865)
Impact - Cross-namespace secret access: Attackers or misconfigured resources could retrieve secrets from namespaces other than the one intended. - privilege escalation: Unauthorized access to secrets could lead to privilege escalation, data exfiltration, or compromise of service accounts and credentials.
Resolution
We removed the incriminated templating function from our codebase. All users should upgrade to the latest version containing this fix.
Workarounds
Use a policy engine such as Kubernetes, Kyverno, Kubewarden, or OPA to prevent the usage of getSecretKey in any ExternalSecret resource.
Details
See also: - https://github.com/external-secrets/external-secrets/issues/5690 - https://github.com/external-secrets/external-secrets/pull/3895
Other sources
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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/github.com/external-secrets/external-secretsto a version that resolves this vulnerability.Fixed in 1.2.0 - Upgrade
Upgrade
external-secrets/external-secretsto a version that resolves this vulnerability.Fixed in 1.2.0 - Configuration
Use a policy engine (Kubernetes admission policies, Kyverno, Kubewarden, or OPA) to prevent the usage of `getSecretKey` in any ExternalSecret resource.
External Secrets Operator getSecretKey template function usage in ExternalSecret resources = disallow
Event History
Frequently Asked Questions
What is the severity of CVE-2026-22822?
CVE-2026-22822 is rated as a high severity vulnerability due to its potential to expose sensitive secrets across namespaces.
How do I fix CVE-2026-22822?
To fix CVE-2026-22822, you should upgrade the external-secrets package to version 1.2.0 or later.
What impact does CVE-2026-22822 have on system security?
CVE-2026-22822 allows unauthorized access to secrets managed by external-secrets, potentially leading to information disclosure.
Which versions of the external-secrets package are affected by CVE-2026-22822?
Versions of the external-secrets package from 0.20.2 up to, but not including, 1.2.0 are affected by CVE-2026-22822.
What functionality is exploited by CVE-2026-22822?
CVE-2026-22822 exploits the getSecretKey template function, which can fetch secrets across namespaces improperly.