Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1yNHBnLXZnNTQtd3h4NM4ABBmY
cert-manager ha a potential slowdown / DoS when parsing specially crafted PEM inputs
Impact
cert-manager packages which call the standard library pem.Decode()
function can take a long time to process specially crafted invalid PEM data.
If an attacker is able to modify PEM data which cert-manager reads (e.g. in a Secret resource), they may be able to use large amounts of CPU in the cert-manager controller pod to effectively create a denial-of-service (DoS) vector for cert-manager in the cluster.
Secrets are limited in size to 1MiB, which reduces the impact of this issue; it was discovered through an ~856kB fuzz test input which causes pem.Decode
to take roughly 750ms to reject the input on an M2 Max Macbook Pro. By way of comparison, a valid PEM-encoded 4096-bit RSA key takes roughly 70µs to parse on the same machine.
Given the required size of PEM data needed to present a realistic DoS vector, an attacker would need to create or insert many different large sized resources in the cluster, and so the best secondary defense is to ensure that sensible limits are placed via RBAC.
This issue affects all versions of cert-manager to have been released since at least v0.1.0 (since pem.Decode
is core functionality for cert-manager). All supported releases are patched.
Patches
The fixed versions are v1.16.2, v1.15.4 and v1.12.14.
- master branch: https://github.com/cert-manager/cert-manager/pull/7400
- release-1.16 branch: https://github.com/cert-manager/cert-manager/pull/7401
- release-1.15 branch: https://github.com/cert-manager/cert-manager/pull/7402
- release-1.12 branch: https://github.com/cert-manager/cert-manager/pull/7403
Workarounds
Ensure that RBAC is scoped correctly in your cluster. If a user is able to modify resources containing PEM data to be able to exploit this, it's like that those permissions are a bigger security threat than this issue - especially for Secret resources.
References
- Upstream issue: https://github.com/golang/go/issues/50116
- Similar issue: https://github.com/sigstore/sigstore/issues/198
- Google OSSFuzz: https://issues.oss-fuzz.com/issues/376728466
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1yNHBnLXZnNTQtd3h4NM4ABBmY
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 1 month ago
Updated: about 1 month ago
Identifiers: GHSA-r4pg-vg54-wxx4
References:
- https://github.com/cert-manager/cert-manager/security/advisories/GHSA-r4pg-vg54-wxx4
- https://github.com/golang/go/issues/50116
- https://github.com/cert-manager/cert-manager/pull/7400
- https://github.com/cert-manager/cert-manager/pull/7401
- https://github.com/cert-manager/cert-manager/pull/7402
- https://github.com/cert-manager/cert-manager/pull/7403
- https://go.dev/issue/50116
- https://pkg.go.dev/vuln/GO-2024-3282
- https://github.com/advisories/GHSA-r4pg-vg54-wxx4
Blast Radius: 0.0
Affected Packages
go:github.com/cert-manager/cert-manager
Dependent packages: 308Dependent repositories: 190
Downloads:
Affected Version Ranges: >= 1.16.0-alpha.0, < 1.16.2, >= 1.13.0-alpha.0, < 1.15.4, < 1.12.14
Fixed in: 1.16.2, 1.15.4, 1.12.14
All affected versions: 0.0.1, 0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3.0, 0.3.1, 0.3.2, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.11.1, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.11.5, 1.12.0, 1.12.1, 1.12.2, 1.12.3, 1.12.4, 1.12.5, 1.12.6, 1.12.7, 1.12.8, 1.12.9, 1.12.10, 1.12.11, 1.12.12, 1.12.13, 1.13.0, 1.13.0-alpha.0, 1.13.0-beta.0, 1.13.1, 1.13.2, 1.13.3, 1.13.4, 1.13.5, 1.13.6, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.14.7, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.16.0, 1.16.0-alpha.0, 1.16.0-alpha.1, 1.16.0-beta.0, 1.16.1
All unaffected versions: 1.12.14, 1.15.4, 1.16.2