GHSA-r4pg-vg54-wxx4: cert-manager ha a potential slowdown / DoS when parsing specially crafted PEM inputs
(updated )
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.
References
- github.com/advisories/GHSA-r4pg-vg54-wxx4
- github.com/cert-manager/cert-manager
- github.com/cert-manager/cert-manager/pull/7400
- github.com/cert-manager/cert-manager/pull/7401
- github.com/cert-manager/cert-manager/pull/7402
- github.com/cert-manager/cert-manager/pull/7403
- github.com/cert-manager/cert-manager/security/advisories/GHSA-r4pg-vg54-wxx4
- github.com/golang/go/issues/50116
- go.dev/issue/50116
- pkg.go.dev/vuln/GO-2024-3282
Detect and mitigate GHSA-r4pg-vg54-wxx4 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →