CVE-2026-42876: ExternalSecrets vulnerable to privilege escalation with secret overwriting
ExternalSecrets allows users to craft Service Account tokens for misconfigured Service Accounts in namespaces the users have access to. Impact A user who only has permission to create ExternalSecret resources can cause the operator to create a Secret that Kubernetes will automatically populate with a long-lived token for the sepcified service account.
Published May 8, 2026 · Updated May 13, 2026
Affected packages
github.com/external-secrets/external-secrets/apis
- Ecosystem
- Go
- Affected
- >= 0.1.0, < 2.4.1
- Fixed in
- 2.4.1
- Check
go list -m github.com/external-secrets/external-secrets/apis
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
ExternalSecrets allows users to craft Service Account tokens for misconfigured Service Accounts in namespaces the users have access to.
Impact
A user who only has permission to create ExternalSecret resources can cause the operator to create a Secret that Kubernetes will automatically populate with a long-lived token for the sepcified service account. This effectively allows the user to impersonate any service account in the namespace without needing direct create permissions on TokenRequest or Secrets of that type.
The problem is mitigated in severity by the fact that the user must have pre-existing permissions already at almost the same level as the escalation later gives. The attacker cannot use this method to gain access to more information without other things also being misconfigured in the ESO installation.
Patches
Disallow this combination including the bootstrap token secret type.
Workarounds
- Add admission control logic to prevent the use of Templates targeting undesired Types
- Remove Service Account Token generation via kube-controller-manager flags
- Restrict User RBAC on production clusters and sensitive namespaces
Credited to factory-nizar, factory-kirk.
References
- https://github.com/external-secrets/external-secrets/security/advisories/GHSA-fq7h-9x26-6j22
- https://github.com/external-secrets/external-secrets/commit/4ddd240af7fe88725d9857b9a0c198073502e288
- https://github.com/external-secrets/external-secrets/releases/tag/v2.4.1
- https://nvd.nist.gov/vuln/detail/CVE-2026-42876
- https://github.com/advisories/GHSA-fq7h-9x26-6j22
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
