CVE-2021-25737 — kubernetes
MEDIUMCVE-2021-25737 is a medium-severity (CVSS 4.8) CWE-184 vulnerability in k8s.io/kubernetes. A fix is available for k8s.io/kubernetes — see the affected versions and patch details below.
Incomplete List of Disallowed Inputs in Kubernetes
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-25737 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
k8s.io/kubernetes🐹k8s.io/kubernetes🐹k8s.io/kubernetes🐹k8s.io/kubernetesReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
A security issue was discovered in Kubernetes where a user may be able to redirect pod traffic to private networks on a Node. Kubernetes already prevents creation of Endpoint IPs in the localhost or link-local range, but the same validation was not performed on EndpointSlice IPs.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | k8s.io/kubernetes | ≥ 1.16.0&&< 1.18.19 | 1.18.19go get k8s.io/kubernetes@v1.18.19 |
| 🐹Go | k8s.io/kubernetes | ≥ 1.19.0&&< 1.19.11 | 1.19.11go get k8s.io/kubernetes@v1.19.11 |
| 🐹Go | k8s.io/kubernetes | ≥ 1.20.0&&< 1.20.7 | 1.20.7go get k8s.io/kubernetes@v1.20.7 |
| 🐹Go | k8s.io/kubernetes | ≥ 1.21.0&&< 1.21.1 | 1.21.1go get k8s.io/kubernetes@v1.21.1 |
Affected Products
kuberneteskubernetesDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for k8s.io/kubernetes, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update k8s.io/kubernetes to 1.18.19 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-25737 is resolved across your whole dependency graph.
Workarounds
Stop reflecting attacker-controlled destinations: resolve every redirect target against an allowlist of paths or hosts you own, prefer a server-side key over a full URL in the request, and reject absolute URLs entirely where the flow only ever needs a relative one.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
OpenShift Container Platform (OCP) 3.11 is not affected by this vulnerability as it does not support EndpointSlices. All current versions of OCP 4 support EndpointSlices and are therefore affected.
* Prevent untrusted users from creating or modifying EndpointSlices * Creating a validating admission webhook that prevents EndpointSlices with endpoint addresses in the 127.0.0.0/8 and 169.254.0.0/16 rangesSource: Red Hat security advisory for CVE-2021-25737 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift Container Platform 4.8 | openshift-0:4.8.0-202107161820.p0.git.051ac4f.assembly.stream.el7 | RHSA-2021:2437 |
Frequently Asked Questions
Is CVE-2021-25737 in your dependencies?
Find it across Go, including transitive dependencies.