Vulnerabilities in pkg:npm/body-parser-xml

PACKAGE
Advisory Identifier: GHSA-2ghc-6v89-pw9j
Advisory Summary

CVE-2021-3666 is a HIGH (CVSS 7.6) body-parser-xml vulnerable to prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Body parser xml libraries in the npm ecosystem. The issue involves body-parser-xml vulnerable to prototype pollution. Remediation is available by upgrading affected packages to version 2.0.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/body-parser-xml

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/body-parser-xml. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-2ghc-6v89-pw9j CVE-2021-3666 HIGH body-parser-xml vulnerable to Prototype Pollution

CVE-2021-3666 at a Glance

CVE Identifier CVE-2021-3666
GHSA Identifier GHSA-2ghc-6v89-pw9j
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Body parser xml
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.6

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:L/A:H).

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 Low (I:L)
Availability High (A:H)

How to Fix CVE-2021-3666

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

body-parser-xml fixed: 2.0.3
npm install body-parser-xml@2.0.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 body-parser-xml

How to Check if You Are Affected

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

npm ls body-parser-xml

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

Note: The npm ls body-parser-xml 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 Body parser xml, 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

body-parser-xml is vulnerable to Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').

CVE-2021-3666 Affected Body parser xml Versions

1 component(s)
Fixed Versions:
2.0.3
Product / Package Ecosystem Affected Versions Fixed Version
body-parser-xml
npm
< 2.0.3
2.0.3

References

Frequently Asked Questions

What is CVE-2021-3666?
CVE-2021-3666 is a security vulnerability in Body parser xml involving body-parser-xml vulnerable to Prototype Pollution under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Body parser xml versions are affected?
Affected versions include releases prior to 2.0.3 across affected packages: body-parser-xml.
What version fixes CVE-2021-3666?
Upgrading to 2.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is body-parser-xml affected?
Yes, body-parser-xml is affected in releases prior to 2.0.3. Upgrade your dependency to 2.0.3 or later.
What is the CVSS score of CVE-2021-3666?
CVE-2021-3666 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H.
What CWE is associated with CVE-2021-3666?
CVE-2021-3666 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-2021-3666?
Run the dependency tree command: 'npm ls body-parser-xml'. 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-2ghc-6v89-pw9j",
  "modified" : "2022-08-10T23:37:49Z",
  "published" : "2021-09-14T20:25:35Z",
  "aliases" : [ "CVE-2021-3666" ],
  "summary" : "body-parser-xml vulnerable to Prototype Pollution",
  "details" : "body-parser-xml is vulnerable to Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "body-parser-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3666"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fiznool/body-parser-xml/commit/d46ca622560f7c9a033cd9321c61e92558150d63"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fiznool/body-parser-xml"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/1-other-fiznool/body-parser-xml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321", "CWE-915" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-14T18:39:31Z",
    "nvd_published_at" : "2021-09-13T18:15:00Z"
  }
}