Vulnerabilities in pkg:npm/@antfu/utils

PACKAGE
Advisory Identifier: GHSA-p2fh-2h23-6grg
Advisory Summary

CVE-2023-2972 is a MODERATE (CVSS 5.4) antfu/utils vulnerable to prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @antfu/utils libraries in the npm ecosystem. The issue involves antfu/utils vulnerable to prototype pollution. Remediation is available by upgrading affected packages to version 0.7.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@antfu/utils

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-p2fh-2h23-6grg CVE-2023-2972 MODERATE antfu/utils vulnerable to prototype pollution

CVE-2023-2972 at a Glance

CVE Identifier CVE-2023-2972
GHSA Identifier GHSA-p2fh-2h23-6grg
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @antfu/utils
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.4

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

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

How to Fix CVE-2023-2972

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

@antfu/utils fixed: 0.7.3
npm install @antfu/utils@0.7.3
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 @antfu/utils

How to Check if You Are Affected

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

npm ls @antfu/utils

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

Note: The npm ls @antfu/utils 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 @antfu/utils, 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

Prototype Pollution in GitHub repository antfu/utils prior to 0.7.3.

CVE-2023-2972 Affected @antfu/utils Versions

1 component(s)
Fixed Versions:
0.7.3
Product / Package Ecosystem Affected Versions Fixed Version
@antfu/utils
npm
< 0.7.3
0.7.3

References

Frequently Asked Questions

What is CVE-2023-2972?
CVE-2023-2972 is a security vulnerability in @antfu/utils involving antfu/utils vulnerable to prototype pollution under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @antfu/utils versions are affected?
Affected versions include releases prior to 0.7.3 across affected packages: @antfu/utils.
What version fixes CVE-2023-2972?
Upgrading to 0.7.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @antfu/utils affected?
Yes, @antfu/utils is affected in releases prior to 0.7.3. Upgrade your dependency to 0.7.3 or later.
What is the CVSS score of CVE-2023-2972?
CVE-2023-2972 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L.
What CWE is associated with CVE-2023-2972?
CVE-2023-2972 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-2023-2972?
Run the dependency tree command: 'npm ls @antfu/utils'. 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-p2fh-2h23-6grg",
  "modified" : "2023-06-02T17:11:18Z",
  "published" : "2023-05-30T12:30:17Z",
  "aliases" : [ "CVE-2023-2972" ],
  "summary" : "antfu/utils vulnerable to prototype pollution",
  "details" : "Prototype Pollution in GitHub repository antfu/utils prior to 0.7.3.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@antfu/utils"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-2972"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/antfu/utils/commit/7f8b16c6181c988bdb96613fbb2533b345f68682"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/antfu/utils"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/009f1cd9-401c-49a7-bd08-be35cff6faef"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-02T17:11:18Z",
    "nvd_published_at" : "2023-05-30T11:15:09Z"
  }
}