Vulnerabilities in pkg:npm/content-security-policy-parser

PACKAGE
Advisory Identifier: GHSA-w2cq-g8g3-gm83
Advisory Summary

CVE-2025-55164 is a HIGH remote code execution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Content security policy parser libraries in the npm ecosystem. The issue involves content-security-policy-parser prototype pollution vulnerability may lead to rce. Remediation is available by upgrading affected packages to version 0.6.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/content-security-policy-parser

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-w2cq-g8g3-gm83 CVE-2025-55164 HIGH content-security-policy-parser Prototype Pollution Vulnerability May Lead to RCE

CVE-2025-55164 at a Glance

CVE Identifier CVE-2025-55164
GHSA Identifier GHSA-w2cq-g8g3-gm83
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Content security policy parser
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-55164

To remediate this vulnerability, upgrade all affected Content security policy 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.

content-security-policy-parser fixed: 0.6.0
npm install content-security-policy-parser@0.6.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 content-security-policy-parser

How to Check if You Are Affected

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

npm ls content-security-policy-parser

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

Note: The npm ls content-security-policy-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 Content security policy 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

### Impact A prototype pollution vulnerability exists in versions 0.5.0 and earlier, wherein if you provide a policy name called `__proto__` you can override the Object prototype. For example: ``` const parse = require('content-security-policy-parser'); const x = parse("default-src 'self'; __proto__ foobar"); console.log('raw print:', x); console.log('toString:', x.toString()); ``` Outputs: ``` raw print: Array { 'default-src': [ "'self'" ] } toString: foobar ``` Whilst no gadget exists in this library, it is possible via other libraries expose functionality that enable RCE. It is customary to label prototype pollution vulnerabilities in this way. The most common effect of this is denial of service, as you can trivially overwrite properties. As the content security policy is provided in HTTP queries, it is incredibly likely that network exploitation is possible. ### Patches There has been a patch implemented a year ago (11 Feb 2024), but low uptake of patched versions has not been observed in the wild - only 17% of weekly downloads are of patched versions. ### Workarounds By disabling prototype method in NodeJS you can neutralise all possible prototype pollution attacks. Provide either `--disable-proto=delete` (recommended) or `--disable-proto=throw` as an argument to `node` to enable this feature. ### References [Issue revealing the problem, January 26 2024](https://github.com/helmetjs/content-security-policy-parser/issues/11) [Commit fixing the problem](https://github.com/helmetjs/content-security-policy-parser/commit/b13a52554f0168af393e3e38ed4a94e9e6aea9dc) Credit to @EvanHahn for patching the vulnerability promptly, and @pnappa (Patrick Nappa) for discovery.

CVE-2025-55164 Affected Content security policy parser Versions

1 component(s)
Fixed Versions:
0.6.0
Product / Package Ecosystem Affected Versions Fixed Version
content-security-policy-parser
npm
< 0.6.0
0.6.0

References

Frequently Asked Questions

What is CVE-2025-55164?
CVE-2025-55164 is a security vulnerability in Content security policy parser involving content-security-policy-parser Prototype Pollution Vulnerability May Lead to RCE under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Content security policy parser versions are affected?
Affected versions include releases prior to 0.6.0 across affected packages: content-security-policy-parser.
What version fixes CVE-2025-55164?
Upgrading to 0.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is content-security-policy-parser affected?
Yes, content-security-policy-parser is affected in releases prior to 0.6.0. Upgrade your dependency to 0.6.0 or later.
What CWE is associated with CVE-2025-55164?
CVE-2025-55164 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-2025-55164?
Run the dependency tree command: 'npm ls content-security-policy-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-w2cq-g8g3-gm83",
  "modified" : "2025-08-12T19:19:42Z",
  "published" : "2025-08-12T18:07:44Z",
  "aliases" : [ "CVE-2025-55164" ],
  "summary" : "content-security-policy-parser Prototype Pollution Vulnerability May Lead to RCE",
  "details" : "### Impact\nA prototype pollution vulnerability exists in versions 0.5.0 and earlier, wherein if you provide a policy name called `__proto__` you can override the Object prototype.\n\nFor example:\n\n```\nconst parse = require('content-security-policy-parser');\n\nconst x = parse(\"default-src 'self'; __proto__ foobar\");\nconsole.log('raw print:', x);\nconsole.log('toString:', x.toString());\n```\n\nOutputs:\n\n```\nraw print: Array { 'default-src': [ \"'self'\" ] }\ntoString: foobar\n```\n\nWhilst no gadget exists in this library, it is possible via other libraries expose functionality that enable RCE. It is customary to label prototype pollution vulnerabilities in this way. The most common effect of this is denial of service, as you can trivially overwrite properties.\n\nAs the content security policy is provided in HTTP queries, it is incredibly likely that network exploitation is possible.\n\n### Patches\nThere has been a patch implemented a year ago (11 Feb 2024), but low uptake of patched versions has not been observed in the wild - only 17% of weekly downloads are of patched versions.\n\n### Workarounds\nBy disabling prototype method in NodeJS you can neutralise all possible prototype pollution attacks. Provide either `--disable-proto=delete` (recommended) or `--disable-proto=throw` as an argument to `node` to enable this feature.\n\n### References\n[Issue revealing the problem, January 26 2024](https://github.com/helmetjs/content-security-policy-parser/issues/11)\n[Commit fixing the problem](https://github.com/helmetjs/content-security-policy-parser/commit/b13a52554f0168af393e3e38ed4a94e9e6aea9dc)\n\nCredit to @EvanHahn for patching the vulnerability promptly, and @pnappa (Patrick Nappa) for discovery.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "content-security-policy-parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/helmetjs/content-security-policy-parser/security/advisories/GHSA-w2cq-g8g3-gm83"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-55164"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/helmetjs/content-security-policy-parser/issues/11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/helmetjs/content-security-policy-parser/commit/b13a52554f0168af393e3e38ed4a94e9e6aea9dc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/helmetjs/content-security-policy-parser"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-12T18:07:44Z",
    "nvd_published_at" : "2025-08-12T16:15:29Z"
  }
}