Regular Expression Denial of Service in tough-cookie
Published 24 Jul 2018 · Updated 8 Nov 2023
Affected package
- Affected
- <2.3.3
- Fixed in
- 2.3.3
npm install tough-cookie@2.3.3Details
Affected versions of tough-cookie are susceptible to a regular expression denial of service.
The amplification on this vulnerability is relatively low - it takes around 2 seconds for the engine to execute on a malicious input which is 50,000 characters in length.
If node was compiled using the -DHTTP_MAX_HEADER_SIZE however, the impact of the vulnerability can be significant, as the primary limitation for the vulnerability is the default max HTTP header length in node.
Recommendation
Update to version 2.3.3 or later.
Is GHSA-g7q5-pjjr-gqvp in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected tough-cookie, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2017-15010
- Linkgithub.com/salesforce/tough-cookie/issues/92
- Linkgithub.com/salesforce/tough-cookie/commit/f1ed420a6a92ea7a5418df6e39e676556bc0c71d
- Linkaccess.redhat.com/errata/RHSA-2017:2912
- Linkaccess.redhat.com/errata/RHSA-2017:2913
- Linkaccess.redhat.com/errata/RHSA-2018:1263
- Linkaccess.redhat.com/errata/RHSA-2018:1264
- Advisorygithub.com/advisories/GHSA-g7q5-pjjr-gqvp
- Packagegithub.com/salesforce/tough-cookie
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6VEBDTGNHVM677SLZDEHMWOP3ISMZSFT
- Linksnyk.io/vuln/npm:tough-cookie:20170905
- Linkwww.npmjs.com/advisories/525
- Linkwww.securityfocus.com/bid/101185
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.