CVE-2021-30458: Wikimedia/parsoid Cross-Site Scripting Vulnerability
MODERATECVE-2021-30458 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Wikimedia/parsoid libraries in the Packagist ecosystem. The issue involves wikimedia parsoid vulnerable to cross-site scripting (xss). Remediation is available by upgrading affected packages to version 0.12.2, 0.11.1.
CVE-2021-30458 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2021-30458
To remediate this vulnerability, upgrade all affected Wikimedia/parsoid dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade wikimedia/parsoid to 0.12.2
Upgrade wikimedia/parsoid to 0.11.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for wikimedia/parsoid
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-30458, inspect your project dependencies for Wikimedia/parsoid:
inspect dependencies for wikimedia/parsoid
Analyze the terminal output to locate any version of Wikimedia/parsoid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.12.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
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 Wikimedia/parsoid, 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
CVE-2021-30458 Affected Wikimedia/parsoid Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
wikimedia/parsoid
|
Packagist |
≥ 0.12
< 0.12.2
|
0.12.2
|
|
wikimedia/parsoid
|
Packagist |
< 0.11.1
|
0.11.1
|
References
Frequently Asked Questions
What is CVE-2021-30458?
Which Wikimedia/parsoid versions are affected?
What version fixes CVE-2021-30458?
Is wikimedia/parsoid affected?
What is the CVSS score of CVE-2021-30458?
What CWE is associated with CVE-2021-30458?
How can I check Packagist dependencies for CVE-2021-30458?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5pqx-77vf-85rw",
"modified" : "2024-06-07T22:12:19Z",
"published" : "2022-05-24T17:47:02Z",
"aliases" : [ "CVE-2021-30458" ],
"summary" : "Wikimedia Parsoid vulnerable to Cross-site Scripting (XSS)",
"details" : "An issue was discovered in Wikimedia Parsoid before 0.11.1 and 0.12.x before 0.12.2. An attacker can send crafted wikitext that Utils/WTUtils.php will transform by using a <meta> tag, bypassing sanitization steps, and potentially allowing for XSS.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "wikimedia/parsoid"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.12"
}, {
"fixed" : "0.12.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "wikimedia/parsoid"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.11.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-30458"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/wikimedia/parsoid/CVE-2021-30458.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/wikimedia/mediawiki-services-parsoid"
}, {
"type" : "WEB",
"url" : "https://phabricator.wikimedia.org/T279451"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/202107-40"
}, {
"type" : "WEB",
"url" : "https://www.mediawiki.org/wiki/Parsoid"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-07T22:12:19Z",
"nvd_published_at" : "2021-04-09T07:15:00Z"
}
}