CVE-2020-27428: Scratch svg renderer Cross-Site Scripting Vulnerability
MODERATECVE-2020-27428 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Scratch svg renderer libraries in the npm ecosystem. The issue involves cross-site scripting in scratch-svg-renderer. Remediation is available in the latest vendor maintenance releases.
CVE-2020-27428 at a Glance
How to Fix CVE-2020-27428
To remediate this vulnerability, upgrade all affected Scratch svg renderer 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 scratch-svg-renderer@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls scratch-svg-renderer
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-27428, inspect your project dependencies using npm:
npm ls scratch-svg-renderer
Analyze the terminal output to locate any version of Scratch svg renderer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls scratch-svg-renderer 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 Scratch svg renderer, 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-2020-27428 Affected Scratch svg renderer Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
scratch-svg-renderer
|
npm |
≤ 0.2.0
|
|
References
Frequently Asked Questions
What is CVE-2020-27428?
Which Scratch svg renderer versions are affected?
What version fixes CVE-2020-27428?
Is scratch-svg-renderer affected?
What CWE is associated with CVE-2020-27428?
How can I check npm dependencies for CVE-2020-27428?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h3vq-wv8j-36gw",
"modified" : "2022-01-07T23:45:14Z",
"published" : "2022-01-08T00:44:33Z",
"aliases" : [ "CVE-2020-27428" ],
"summary" : "Cross-site Scripting in Scratch-Svg-Renderer",
"details" : "A DOM-based cross-site scripting (XSS) vulnerability in Scratch-Svg-Renderer v0.2.0 allows attackers to execute arbitrary web scripts or HTML via a crafted sb3 file.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "scratch-svg-renderer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-27428"
}, {
"type" : "WEB",
"url" : "https://github.com/LLK/scratch-svg-renderer/commit/7c74ec7de3254143ec3c557677f5355a90a3d07f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/LLK/scratch-svg-renderer"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-07T23:45:14Z",
"nvd_published_at" : "2022-01-06T00:15:00Z"
}
}