CVE-2020-7741: Hellojs Cross-Site Scripting Vulnerability
CRITICALCVE-2020-7741 is a CRITICAL (CVSS 9.9) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Hellojs libraries in the npm ecosystem. The issue involves xss in hello.js. Remediation is available by upgrading affected packages to version 1.18.6.
CVE-2020-7741 at a Glance
Security Impact
CVSS: 9.9
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:N/S:C/C:L/I:L/A:H).
How to Fix CVE-2020-7741
To remediate this vulnerability, upgrade all affected Hellojs 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 hellojs@1.18.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls hellojs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-7741, inspect your project dependencies using npm:
npm ls hellojs
Analyze the terminal output to locate any version of Hellojs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.18.6), your application is affected.
Note: The npm ls hellojs 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 Hellojs, 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-7741 Affected Hellojs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hellojs
|
npm |
< 1.18.6
|
1.18.6
|
References
Frequently Asked Questions
What is CVE-2020-7741?
Which Hellojs versions are affected?
What version fixes CVE-2020-7741?
Is hellojs affected?
What is the CVSS score of CVE-2020-7741?
What CWE is associated with CVE-2020-7741?
How can I check npm dependencies for CVE-2020-7741?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7jh9-6cpf-h4m7",
"modified" : "2023-09-12T18:13:25Z",
"published" : "2021-01-13T19:07:01Z",
"aliases" : [ "CVE-2020-7741" ],
"summary" : "XSS in hello.js",
"details" : "This affects the package hello.js before 1.18.6. The code get the param oauth_redirect from url and pass it to location.assign without any check and sanitisation. So we can simply pass some XSS payloads into the url param oauth_redirect, such as `javascript:alert(1)`.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "hellojs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.18.6"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7741"
}, {
"type" : "WEB",
"url" : "https://github.com/MrSwitch/hello.js/commit/d6f5137f30de6e0ef7048191ee6ae575fdc2f669"
}, {
"type" : "WEB",
"url" : "https://github.com/MrSwitch/hello.js/blob/3b79ec93781b3d7b9c0b56f598e060301d1f3e73/dist/hello.all.js%23L1545"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-HELLOJS-1014546"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-01-13T19:06:37Z",
"nvd_published_at" : "2020-10-06T15:15:00Z"
}
}