Vulnerabilities in pkg:npm/requirejs

PACKAGE
Advisory Identifier: GHSA-x3m3-4wpv-5vgc
Advisory Summary

CVE-2024-38999 is a HIGH (CVSS 10.0) jrburke requirejs vulnerable to prototype vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Requirejs libraries in the npm ecosystem. The issue involves jrburke requirejs vulnerable to prototype pollution. Remediation is available by upgrading affected packages to version 2.3.7.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/requirejs

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-x3m3-4wpv-5vgc CVE-2024-38999 HIGH jrburke requirejs vulnerable to prototype pollution

CVE-2024-38999 at a Glance

CVE Identifier CVE-2024-38999
GHSA Identifier GHSA-x3m3-4wpv-5vgc
Severity HIGH
CVSS v3.1 Base Score 10.0
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Requirejs
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

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:H/I:H/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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-38999

To remediate this vulnerability, upgrade all affected Requirejs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

requirejs fixed: 2.3.7
npm install requirejs@2.3.7
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 requirejs

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-38999, inspect your project dependencies using npm:

npm ls requirejs

Analyze the terminal output to locate any version of Requirejs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.7), your application is affected.

Note: The npm ls requirejs 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Requirejs, 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

jrburke requirejs v2.3.6 was discovered to contain a prototype pollution via the function `s.contexts._.configure`. This vulnerability allows attackers to execute arbitrary code or cause a Denial of Service (DoS) via injecting arbitrary properties.

CVE-2024-38999 Affected Requirejs Versions

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

References

Frequently Asked Questions

What is CVE-2024-38999?
CVE-2024-38999 is a security vulnerability in Requirejs involving jrburke requirejs vulnerable to prototype pollution under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Requirejs versions are affected?
Affected versions include releases prior to 2.3.7 across affected packages: requirejs.
What version fixes CVE-2024-38999?
Upgrading to 2.3.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is requirejs affected?
Yes, requirejs is affected in releases prior to 2.3.7. Upgrade your dependency to 2.3.7 or later.
What is the CVSS score of CVE-2024-38999?
CVE-2024-38999 has a CVSS v3.1 base score of 10.0 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-38999?
CVE-2024-38999 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2024-38999?
Run the dependency tree command: 'npm ls requirejs'. 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-x3m3-4wpv-5vgc",
  "modified" : "2024-07-25T15:25:40Z",
  "published" : "2024-07-01T15:32:19Z",
  "aliases" : [ "CVE-2024-38999" ],
  "summary" : "jrburke requirejs vulnerable to prototype pollution",
  "details" : "jrburke requirejs v2.3.6 was discovered to contain a prototype pollution via the function `s.contexts._.configure`. This vulnerability allows attackers to execute arbitrary code or cause a Denial of Service (DoS) via injecting arbitrary properties.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "requirejs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.3.6"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38999"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/requirejs/r.js/issues/1015"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/requirejs/requirejs/issues/1854"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/requirejs/requirejs/pull/1856/commits/ebd7a2ff71473542fa132d0d15c10fb4ed1539e1"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/mestrtee/9acae342285bd2998fa09ebcb1e6d30a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/requirejs/r.js"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-REQUIREJS-5416713"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-10T16:50:19Z",
    "nvd_published_at" : "2024-07-01T13:15:05Z"
  }
}