Vulnerabilities in pkg:npm/hellojs

PACKAGE
Advisory Identifier: GHSA-7jh9-6cpf-h4m7
Advisory Summary

CVE-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.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/hellojs

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/hellojs. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7jh9-6cpf-h4m7 CVE-2020-7741 CRITICAL XSS in hello.js
GHSA-g3vf-47fv-8f3c CVE-2021-26505 CRITICAL MrSwitch hello.js vulnerable to prototype pollution

CVE-2020-7741 at a Glance

CVE Identifier CVE-2020-7741
GHSA Identifier GHSA-7jh9-6cpf-h4m7
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Hellojs
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability High (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.

hellojs fixed: 1.18.6
npm install hellojs@1.18.6
Verify Direct and Transitive Dependencies

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

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)`.

CVE-2020-7741 Affected Hellojs Versions

1 component(s)
Fixed Versions:
1.18.6
Product / Package Ecosystem Affected Versions Fixed Version
hellojs
npm
< 1.18.6
1.18.6

References

Frequently Asked Questions

What is CVE-2020-7741?
CVE-2020-7741 is a security vulnerability in Hellojs involving XSS in hello.js under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Hellojs versions are affected?
Affected versions include releases prior to 1.18.6 across affected packages: hellojs.
What version fixes CVE-2020-7741?
Upgrading to 1.18.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hellojs affected?
Yes, hellojs is affected in releases prior to 1.18.6. Upgrade your dependency to 1.18.6 or later.
What is the CVSS score of CVE-2020-7741?
CVE-2020-7741 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H.
What CWE is associated with CVE-2020-7741?
CVE-2020-7741 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for CVE-2020-7741?
Run the dependency tree command: 'npm ls hellojs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}