Vulnerabilities/

LiquidJS Vulnerable to ReDoS via Quadratic Backtracking in `strip_html` Filter Regex

Severity:
High

Description

The built-in strip_html filter in liquidjs uses a regex containing four lazy-quantified alternatives. When the input contains many <script, <style, or <!-- opener tokens without matching closers, the V8 regex engine performs O(N²) backtracking, blocking the Node.js event loop. A single ~350 KB request ('<script'.repeat(50000)) stalls the process for ~10 seconds; cost grows quadratically with input size.

Recommendation

Update the liquidjs package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
liquidjs
Anything's wrong? Let us know Last updated on May 27, 2026