GHSA-jjmg-x456-w976: Csrf csrf Incorrect Default Cookie Name And Vulnerability
LOWGHSA-jjmg-x456-w976 is a LOW incorrect default cookie name and vulnerability (General Security Weakness) affecting Csrf csrf libraries in the npm ecosystem. The issue involves incorrect default cookie name and recommendation. Remediation is available by upgrading affected packages to version 2.2.1.
GHSA-jjmg-x456-w976 at a Glance
How to Fix GHSA-jjmg-x456-w976
To remediate this vulnerability, upgrade all affected Csrf csrf 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 csrf-csrf@2.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls csrf-csrf
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-jjmg-x456-w976, inspect your project dependencies using npm:
npm ls csrf-csrf
Analyze the terminal output to locate any version of Csrf csrf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.1), your application is affected.
Note: The npm ls csrf-csrf 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 Csrf csrf, 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-jjmg-x456-w976 Affected Csrf csrf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
csrf-csrf
|
npm |
< 2.2.1
|
2.2.1
|
References
Frequently Asked Questions
What is GHSA-jjmg-x456-w976?
Which Csrf csrf versions are affected?
What version fixes GHSA-jjmg-x456-w976?
Is csrf-csrf affected?
What CWE is associated with GHSA-jjmg-x456-w976?
How can I check npm dependencies for GHSA-jjmg-x456-w976?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jjmg-x456-w976",
"modified" : "2022-10-10T20:59:02Z",
"published" : "2022-10-10T20:59:02Z",
"aliases" : [ ],
"summary" : "Incorrect default cookie name and recommendation",
"details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nThe default cookie name (and documentation recommendation) was prefixed with `Host__` instead of `__Host-`. The point of this prefix is for additional security, to ensure that, when no domain option is provided in the cookie options, we can guarantee the cookie came from the correct domain.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nYes, the problem is patched from version 2.2.1, this will not be back ported, but you can use the workaround described below.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nYou can work around this by providing a custom `cookieName` as part of the options, which is correctly prefixed with `__Host-`.\n\n### References\n_Are there any links users can visit to find out more?_\n\nhttps://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#cookie-with-__host-prefix\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Reach out on the [Psifi Solutions Discord](https://psifisolutions.com/discord) in the `#psifi-support` channel\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "csrf-csrf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Psifi-Solutions/csrf-csrf/security/advisories/GHSA-jjmg-x456-w976"
}, {
"type" : "WEB",
"url" : "https://github.com/Psifi-Solutions/csrf-csrf/commit/8f1ce8db97d945a4bb7f39f0b43c6041fa83d675"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Psifi-Solutions/csrf-csrf"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-10T20:59:02Z",
"nvd_published_at" : null
}
}