re2js (JavaScript package (npm)) has a high-severity security problem: RE2JS: Quadratic-time denial of service in re2js lookbehind matching.
Am I affected?
Yes, if your website or app uses re2js >= 2.2.0, < 2.8.7 (JavaScript package (npm)), directly or as a dependency of another package. WordPress sites usually are not affected unless a plugin or custom code bundles it.
What to do
- 1Check if you use itSearch your project's dependency files (composer.json, package.json, requirements.txt or lock files) for re2js, including as a dependency of another package.
- 2Update to 2.8.7 or laterUpdate the package, run your tests and deploy. For example: npm install [email protected]
- 3Ask your developerIf your site or app was built by someone else, send them this page. A WordPress plugin can bundle this package too.
Technical summary
### Summary Using the opt-in `LOOKBEHINDS` flag together with any repeated-matching API (`matcher().find()` in a loop, `matchAll()`, `split()`, `matcher().replaceAll()`) causes quadratic-time (Θ(n²)) matching, contradicting the library's own "linear time matching" guarantee