GHSA-c3m8-x3cg-qm2c: Helmet csp Configuration Override Vulnerability
MODERATEGHSA-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
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).
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.
npm install helmet-csp@2.9.1
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
GHSA-c3m8-x3cg-qm2c Affected Helmet csp Versions
1 component(s)| 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?
Which Helmet csp versions are affected?
What version fixes GHSA-c3m8-x3cg-qm2c?
Is helmet-csp affected?
What is the CVSS score of GHSA-c3m8-x3cg-qm2c?
What CWE is associated with GHSA-c3m8-x3cg-qm2c?
How can I check npm dependencies for GHSA-c3m8-x3cg-qm2c?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}