CVE-2020-27224: @theia/preview Cross-Site Scripting Vulnerability
CRITICALCVE-2020-27224 is a CRITICAL (CVSS 9.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @theia/preview libraries in the npm ecosystem. The issue involves cross-site scripting (xss) in eclipse theia. Remediation is available by upgrading affected packages to version 1.3.0.
CVE-2020-27224 at a Glance
Security Impact
CVSS: 9.6
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:H/I:H/A:H).
How to Fix CVE-2020-27224
To remediate this vulnerability, upgrade all affected @theia/preview 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 @theia/preview@1.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @theia/preview
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-27224, inspect your project dependencies using npm:
npm ls @theia/preview
Analyze the terminal output to locate any version of @theia/preview in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.0), your application is affected.
Note: The npm ls @theia/preview 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 @theia/preview, 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-27224 Affected @theia/preview Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@theia/preview
|
npm |
< 1.3.0
|
1.3.0
|
References
Frequently Asked Questions
What is CVE-2020-27224?
Which @theia/preview versions are affected?
What version fixes CVE-2020-27224?
Is @theia/preview affected?
What is the CVSS score of CVE-2020-27224?
What CWE is associated with CVE-2020-27224?
How can I check npm dependencies for CVE-2020-27224?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gcm9-cc3r-c6vj",
"modified" : "2021-03-29T22:10:04Z",
"published" : "2021-04-13T15:18:09Z",
"aliases" : [ "CVE-2020-27224" ],
"summary" : "Cross-site Scripting (XSS) in Eclipse Theia",
"details" : "In Eclipse Theia versions up to and including 1.2.0, the Markdown Preview (@theia/preview), can be exploited to execute arbitrary code.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@theia/preview"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 1.2.0"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-27224"
}, {
"type" : "WEB",
"url" : "https://github.com/eclipse-theia/theia/issues/7954"
}, {
"type" : "WEB",
"url" : "https://github.com/eclipse-theia/theia/pull/7971"
}, {
"type" : "WEB",
"url" : "https://omespino.com/write-up-google-bug-bounty-xss-to-cloud-shell-instance-takeover-rce-as-root-5000-usd"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-29T22:10:04Z",
"nvd_published_at" : "2021-02-24T17:15:00Z"
}
}