GHSA-98pf-gfh3-x3mp: Readthedocs Cross-Site Scripting Vulnerability
MODERATEGHSA-98pf-gfh3-x3mp is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Readthedocs libraries in the npm ecosystem. The issue involves read the docs vulnerable to cross-site scripting (xss). Remediation is available by upgrading affected packages to version 8.8.1.
GHSA-98pf-gfh3-x3mp at a Glance
How to Fix GHSA-98pf-gfh3-x3mp
To remediate this vulnerability, upgrade all affected Readthedocs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install readthedocs@8.8.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls readthedocs
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-98pf-gfh3-x3mp, inspect your project dependencies using npm:
npm ls readthedocs
Analyze the terminal output to locate any version of Readthedocs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.8.1), your application is affected.
Note: The npm ls readthedocs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Readthedocs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-98pf-gfh3-x3mp Affected Readthedocs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
readthedocs
|
npm |
< 8.8.1
|
8.8.1
|
References
Frequently Asked Questions
What is GHSA-98pf-gfh3-x3mp?
Which Readthedocs versions are affected?
What version fixes GHSA-98pf-gfh3-x3mp?
Is readthedocs affected?
What CWE is associated with GHSA-98pf-gfh3-x3mp?
How can I check npm dependencies for GHSA-98pf-gfh3-x3mp?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-98pf-gfh3-x3mp",
"modified" : "2022-11-10T16:02:51Z",
"published" : "2022-11-10T16:02:51Z",
"aliases" : [ ],
"summary" : "Read the Docs vulnerable to Cross-Site Scripting (XSS)",
"details" : "### Impact\n\nThis vulnerability allowed a malicious user to serve arbitrary HTML files from the main application domain (readthedocs[.]org/readthedocs[.]com) by exploiting a vulnerability in the code that serves downloadable content from a project. \n\nExploiting this would have required the attacker to get a logged-in user to visit the malicious URL, which would have allowed the attacker to take control of the user's session with JavaScript (making requests to the API/site on behalf of the user). This URL would have looked something like `hxxps[:]//readthedocs[.]org/projects/attacker-project/downloads/html/version-with-javascript-attack/`.\n\n### Patches\n\nThis issue has been patched in our 8.8.1 release.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "readthedocs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "8.8.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/readthedocs/readthedocs.org/security/advisories/GHSA-98pf-gfh3-x3mp"
}, {
"type" : "WEB",
"url" : "https://github.com/readthedocs/readthedocs.org/commit/b0ae626acd13882170ec5888e35f3ef2e48e6ff6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/readthedocs/readthedocs.org"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-11-10T16:02:51Z",
"nvd_published_at" : null
}
}