Denial of Service Vulnerability in LiquidJS strip_html Filter
An infinite loop vulnerability in the LiquidJS strip_html filter, tracked as CVE-2026-61556, allows attackers to trigger a process-wide denial of service by providing specific malformed HTML strings.
CVE search metadata
CVE search record: CVE-2026-61556. EPSS: 0.32%. KEV: no. Product: liquidjs (>= 10.26.0, < 10.27.1). Brief: Denial of Service Vulnerability in LiquidJS strip_html Filter. Brief link: https://feed.craftedsignal.io/briefs/2026-09-liquidjs-infinite-loop/
LiquidJS versions 10.26.0 through 10.27.0 contain a vulnerability in the strip_html filter that leads to an infinite loop, resulting in a denial of service (DoS). The flaw exists in src/filters/html.ts due to improper state management during string parsing. When an input string contains a < character that is not followed by a matching > (or a corresponding closing tag for script, style, or comment blocks), the loop index i fails to increment. Because the loop logic repeatedly encounters the same unclosed < at the same index, the process hangs indefinitely. This vulnerability is highly accessible, requiring only a two-character input (e.g., "a<") to exhaust system resources. Given the prevalence of template engines in web applications, this vulnerability poses a significant risk for server-side resource exhaustion.
Attack Chain
- Attacker identifies a web application or internal service utilizing LiquidJS to render user-supplied input.
- Attacker crafts a malicious payload containing an unclosed HTML tag structure, such as "a<" or similar variants lacking a closing
>. - Attacker submits the malicious input to an application endpoint that triggers the
strip_htmlfilter processing. - The LiquidJS engine initializes the
strip_htmlfunction with the attacker-controlled input. - The function's
whileloop locates the<at index 1 but fails to find a matching closing delimiter. - The logic checks
if (i === lt), which remains true becauseinever advances, returning the control flow to the start of the loop. - The process consumes CPU cycles continuously in an infinite loop.
- The application worker process hangs, leading to a denial of service for that specific thread or process.
Impact
Successful exploitation results in a complete denial of service for the affected application process. Because the infinite loop is triggered by minimal input (two characters), an attacker can easily overwhelm web servers or template-rendering services, leading to system unavailability and resource exhaustion. This impacts any sector deploying LiquidJS in environments that process untrusted user input through the strip_html filter.
Recommendation
- Upgrade the
liquidjspackage to version 10.27.1 or later immediately to include the patch for CVE-2026-61556. - Audit applications using
strip_htmlto determine if user-controlled input is passed directly to this filter without pre-validation. - Implement resource monitoring (CPU usage per worker process) to detect stalled processes indicative of DoS attempts.
Immediate actions
Upgrade liquidjs to 10.27.1
Mitigations
Upgrade liquidjs to version 10.27.1 or later
CVE-2026-61556