Regular Expression Denial of Service in Acorn
Affected releases · acorn
- 7.x7.0.0 – 7.1.0Fixed in 7.1.1
- 6.x6.0.0 – 6.4.0Fixed in 6.4.1
- 5.x5.5.0 – 5.7.3Fixed in 5.7.4
On 7.x, the newest line:
npm install acorn@7.1.1Not affected
8.0.0 – 8.19.0
39 releases, latest
Affected
7.0.0 – 7.1.0
2 releases
Fixed
7.1.1 – 7.4.1
6 releases
Affected
6.0.0 – 6.4.0
14 releases
Fixed
6.4.1 – 6.4.2
2 releases
Not affected
5.0.0 – 5.4.1
12 releases
Affected
5.5.0 – 5.7.3
11 releases
Fixed
5.7.4
1 release
Is your project affected?
Paste your package.json, or type the range you declare for acorn. It is read in your browser and sent nowhere.
What happens
Affected versions of acorn are vulnerable to Regular Expression Denial of Service. A regex in the form of /[x-\ud800]/u causes the parser to enter an infinite loop. The string is not valid UTF16 which usually results in it being sanitized before reaching the parser. If an application processes untrusted input and passes it directly to acorn, attackers may leverage the vulnerability leading to Denial of Service.