GHSA-c3m8-x3cg-qm2c: Helmet csp Configuration Override Vulnerability

MODERATE
CVSS 6.5
Published
Advisory Summary

GHSA-c3m8-x3cg-qm2c is a MODERATE (CVSS 6.5) configuration override vulnerability (General Security Weakness) affecting Helmet csp libraries in the npm ecosystem. The issue involves configuration override in helmet-csp. Remediation is available by upgrading affected packages to version 2.9.1.

GHSA-c3m8-x3cg-qm2c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c3m8-x3cg-qm2c
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification General Security Weakness
Affected Product Helmet csp
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:U/C:L/I:L/A:N).

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

How to Fix GHSA-c3m8-x3cg-qm2c

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

helmet-csp fixed: 2.9.1
npm install helmet-csp@2.9.1
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 helmet-csp

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-c3m8-x3cg-qm2c, inspect your project dependencies using npm:

npm ls helmet-csp

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

Note: The npm ls helmet-csp 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 General Security Weakness. In Helmet csp, 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

Versions of `helmet-csp` before to 2.9.1 are vulnerable to a Configuration Override affecting the application's Content Security Policy (CSP). The package's browser sniffing for Firefox deletes the `default-src` CSP policy, which is the fallback policy. This allows an attacker to remove an application's default CSP, possibly rendering the application vulnerable to Cross-Site Scripting. ## Recommendation Upgrade to version 2.9.1 or later. Setting the `browserSniff` configuration to `false` in vulnerable versions also mitigates the issue.

GHSA-c3m8-x3cg-qm2c Affected Helmet csp Versions

1 component(s)
Fixed Versions:
2.9.1
Product / Package Ecosystem Affected Versions Fixed Version
helmet-csp
npm
≥ 1.2.2
< 2.9.1
2.9.1

References

Frequently Asked Questions

What is GHSA-c3m8-x3cg-qm2c?
GHSA-c3m8-x3cg-qm2c is a security vulnerability in Helmet csp involving Configuration Override in helmet-csp under General Security Weakness.
Which Helmet csp versions are affected?
Affected versions include releases prior to 2.9.1 across affected packages: helmet-csp.
What version fixes GHSA-c3m8-x3cg-qm2c?
Upgrading to 2.9.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is helmet-csp affected?
Yes, helmet-csp is affected in releases prior to 2.9.1. Upgrade your dependency to 2.9.1 or later.
What is the CVSS score of GHSA-c3m8-x3cg-qm2c?
GHSA-c3m8-x3cg-qm2c has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-c3m8-x3cg-qm2c?
GHSA-c3m8-x3cg-qm2c is classified under General Security Weakness.
How can I check npm dependencies for GHSA-c3m8-x3cg-qm2c?
Run the dependency tree command: 'npm ls helmet-csp'. 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-c3m8-x3cg-qm2c",
  "modified" : "2021-09-29T18:45:07Z",
  "published" : "2020-09-03T20:39:53Z",
  "aliases" : [ ],
  "summary" : "Configuration Override in helmet-csp",
  "details" : "Versions of `helmet-csp` before to 2.9.1 are vulnerable to a Configuration Override affecting the application's Content Security Policy (CSP). The package's browser sniffing for Firefox deletes the `default-src` CSP policy, which is the fallback policy. This allows an attacker to remove an application's default CSP, possibly rendering the application vulnerable to Cross-Site Scripting.\n\n\n## Recommendation\n\nUpgrade to version 2.9.1 or later. Setting the `browserSniff` configuration to `false` in vulnerable versions also mitigates the issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "helmet-csp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.2"
      }, {
        "fixed" : "2.9.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/helmetjs/csp/commit/67a69baafa8198a154f0505a0cf0875f76f6186a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/helmetjs/csp"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-HELMETCSP-469436"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1176"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:50:01Z",
    "nvd_published_at" : null
  }
}