Vulnerabilities in pkg:npm/@apidevtools/json-schema-ref-parser

PACKAGE
Advisory Identifier: GHSA-5f97-h2c2-826q
Advisory Summary

CVE-2024-29651 is a HIGH (CVSS 8.1) json-schema-ref-parser prototype pollution issue vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @apidevtools/json schema ref parser libraries in the npm ecosystem. The issue involves json-schema-ref-parser prototype pollution issue. Remediation is available by upgrading affected packages to version 11.2.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@apidevtools/json-schema-ref-parser

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@apidevtools/json-schema-ref-parser. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5f97-h2c2-826q CVE-2024-29651 HIGH json-schema-ref-parser Prototype Pollution issue

CVE-2024-29651 at a Glance

CVE Identifier CVE-2024-29651
GHSA Identifier GHSA-5f97-h2c2-826q
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @apidevtools/json schema ref parser
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-29651

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

@apidevtools/json-schema-ref-parser fixed: 11.2.0
npm install @apidevtools/json-schema-ref-parser@11.2.0
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 @apidevtools/json-schema-ref-parser

How to Check if You Are Affected

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

npm ls @apidevtools/json-schema-ref-parser

Analyze the terminal output to locate any version of @apidevtools/json schema ref parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.2.0), your application is affected.

Note: The npm ls @apidevtools/json-schema-ref-parser 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 @apidevtools/json schema ref parser, 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

A Prototype Pollution issue in API Dev Tools json-schema-ref-parser v.11.0.0 and v.11.1.0 allows a remote attacker to execute arbitrary code via the `bundle()`, `parse()`, `resolve()`, `dereference()` functions.

CVE-2024-29651 Affected @apidevtools/json schema ref parser Versions

1 component(s)
Fixed Versions:
11.2.0
Product / Package Ecosystem Affected Versions Fixed Version
@apidevtools/json-schema-ref-parser
npm
≥ 11.0.0
< 11.2.0
11.2.0

References

Frequently Asked Questions

What is CVE-2024-29651?
CVE-2024-29651 is a security vulnerability in @apidevtools/json schema ref parser involving json-schema-ref-parser Prototype Pollution issue under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @apidevtools/json schema ref parser versions are affected?
Affected versions include releases prior to 11.2.0 across affected packages: @apidevtools/json-schema-ref-parser.
What version fixes CVE-2024-29651?
Upgrading to 11.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @apidevtools/json-schema-ref-parser affected?
Yes, @apidevtools/json-schema-ref-parser is affected in releases prior to 11.2.0. Upgrade your dependency to 11.2.0 or later.
What is the CVSS score of CVE-2024-29651?
CVE-2024-29651 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-29651?
CVE-2024-29651 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-29651?
Run the dependency tree command: 'npm ls @apidevtools/json-schema-ref-parser'. 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-5f97-h2c2-826q",
  "modified" : "2024-05-20T21:03:12Z",
  "published" : "2024-05-20T18:31:23Z",
  "aliases" : [ "CVE-2024-29651" ],
  "summary" : "json-schema-ref-parser Prototype Pollution issue",
  "details" : "A Prototype Pollution issue in API Dev Tools json-schema-ref-parser v.11.0.0 and v.11.1.0 allows a remote attacker to execute arbitrary code via the `bundle()`, `parse()`, `resolve()`, `dereference()` functions.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@apidevtools/json-schema-ref-parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.2.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 11.1.0"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-29651"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/APIDevTools/json-schema-ref-parser/commit/8cad7f72c15b198f4d0b5b1c8a3a979b2e4baa82"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/tariqhawis/5db76b38112bba756615b688c32409ad"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/APIDevTools/json-schema-ref-parser"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-20T21:03:12Z",
    "nvd_published_at" : "2024-05-20T18:15:10Z"
  }
}