CVE-2021-25313 — rancher
MEDIUMCVE-2021-25313 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in github.com/rancher/rancher. A fix is available for github.com/rancher/rancher — see the affected versions and patch details below.
Rancher Cross-site Scripting Vulnerability
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
github.com/rancher/rancher🐹github.com/rancher/rancher🐹github.com/rancher/rancherReal-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 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Rancher allows remote attackers to execute JavaScript via malicious links. This issue affects: SUSE Rancher Rancher versions prior to 2.5.6.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/rancher/rancher | ≥ 2.5.0&&< 2.5.6 | 2.5.6go get github.com/rancher/rancher@v2.5.6 |
| 🐹Go | github.com/rancher/rancher | ≥ 2.4.0&&< 2.4.14 | 2.4.14go get github.com/rancher/rancher@v2.4.14 |
| 🐹Go | github.com/rancher/rancher | all versions | 2.3.11go get github.com/rancher/rancher@v2.3.11 |
Affected Products
ranchersuseDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/rancher/rancher, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/rancher/rancher to 2.5.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-25313 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2021-25313 in your dependencies?
Find it across Go, including transitive dependencies.