Junglewise Threat Intelligence

CVE-2017-15010: tough-cookie regular expression denial of service

CVE-2017-15010 · Severity: low · CVSS 3 · Published 2018-07-24

Technologies: tough-cookie (npm). Vendors: npm.

Executive brief

tough-cookie is a popular Node.js library for parsing and managing HTTP cookies. A maliciously crafted cookie string can cause the parser's regular expression engine to consume excessive CPU time, potentially making Node.js applications unresponsive. This is particularly severe if the application has increased HTTP header size limits.

Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) in the cookie-parsing regex `/^(([^=;]+))\s*=\s*([^\n\r\0]*)/`. Adversarial input around 50,000 characters in length can cause ~2.5 seconds of matching time due to catastrophic backtracking. The attack is network-reachable and requires no authentication—any HTTP request with a malicious Cookie header can trigger it. An attacker can cause denial of service by exhausting CPU resources on the server. The vulnerability was fixed in version 2.3.3 and later.

Affected products

  • Salesforce tough-cookie before 2.3.3

Timeline

  • 2017-09-05: disclosed
  • 2017: patched: Fix available in version 2.3.3
  • 2018-07-24: advisory

References

Related threats