GitHub Advisoryadvisory · npm
GHSA-f523-2f5j-gfcg Regular Expression Denial of Service in timespan
HIGH
Official page ↗
- Aliases
- CVE-2017-16115
- Ecosystem
- npm
- Packages
- timespan
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses
- CWE-400
- Reviewed
- 2020-06-16
Affected packages
• npm timespan: <= 2.3.0 (no fix yet)
Description
Affected versions of `timespan` are vulnerable to a regular expression denial of service when parsing dates.
The amplification for this vulnerability is significant, with 50,000 characters resulting in the event loop being blocked for around 10 seconds.
Recommendation
No direct patch is available for this vulnerability.
Currently, the best available solution is to use a functionally equivalent alternative package.
It is also sufficient to ensure that user input is not being passed into `timespan`, or that the maximum length of such user input is drastically reduced. Limiting the input length to 150 characters should be sufficient in most cases.
Related
Alias · CVE (1)
- CVE-2017-16115 The timespan module is vulnerable to regular expression denial of service. vulnerability
Weakness · CWE (1)
- CWE-400 Uncontrolled Resource Consumption weakness