GitHub Advisoryadvisory · npm
GHSA-r7g9-xpmj-5fcq LiquidJS Vulnerable to ReDoS via Quadratic Backtracking in `strip_html` Filter Regex
HIGH
Official page ↗
- Aliases
- CVE-2026-45617
- Ecosystem
- npm
- Packages
- liquidjs
- 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-1333
- Reviewed
- 2026-05-27
Affected packages
• npm liquidjs: < 10.26.0 → fixed in 10.26.0
Description
Summary
The built-in `strip_html` filter in liquidjs uses a regex containing four lazy-quantified alternatives. When the input contains many `|||/g, '')
}
```
The regex contains four lazy patterns:
1. ``
2. ``
3. ``
4. ``
For an input like `' {
for (const n of [1000, 2000, 4000, 8000, 16000]) {
const payload = ' {
const payload = ')[^|)[^|)[^-]*)*-->|]*>/g,
''
)
```
This unrolls each lazy quantifier so each ``, ``, comment, or generic tag, and emit nothing for those ranges.
Either fix should be combined with charging the regex output cost honestly to `memoryLimit` and (defensively) capping input length up front:
```ts
export function strip_html (this: FilterImpl, v: string) {
const str = stringify(v)
this.context.memoryLimit.use(str.length)
// ... linear-time strip implementation here
}
```
Related
Alias · CVE (1)
- CVE-2026-45617 LiquidJS is a Shopify/GitHub Pages compatible template engine written in pure JavaScript. vulnerability
Weakness · CWE (1)
- CWE-1333 Inefficient Regular Expression Complexity weakness
References
- https://github.com/harttle/liquidjs/security/advisories/GHSA-r7g9-xpmj-5fcq web
- https://nvd.nist.gov/vuln/detail/CVE-2026-45617 advisory
- https://github.com/harttle/liquidjs/commit/3616a744b9abeb425c217b340a2397d46176afb8 web
- https://github.com/harttle/liquidjs package
- https://github.com/harttle/liquidjs/releases/tag/v10.26.0 web