CVE-2026-41311
Memory Exhaustion in LiquidJS via Circular Block References
Publication date: 2026-05-09
Last updated on: 2026-05-09
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| harttle | liquidjs | to 10.25.7 (exc) |
| harttle | liquidjs | 10.25.7 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-674 | The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-41311 is a Denial of Service (DoS) vulnerability in the LiquidJS library affecting versions 10.25.2 and earlier.
The issue arises from a circular block reference in the {% layout %} and {% block %} tags, which creates an infinite recursive loop during template rendering.
This loop consumes excessive memory (up to approximately 4GB) and crashes the Node.js process with a "JavaScript heap out of memory" error.
The vulnerability occurs when a block with the same name is nested inside another block of the same name in a child template.
Any user who can submit a Liquid template can exploit this vulnerability without authentication or special configuration.
How can this vulnerability impact me? :
This vulnerability can cause a complete Denial of Service by crashing the Node.js process due to memory exhaustion.
It consumes all available memory (around 4GB), leading to a fatal error and service disruption.
Applications that accept user-provided Liquid templates, such as CMS platforms, email template builders, or static site generators, are particularly vulnerable.
The attack requires no privileges or user interaction, making it easy for any user submitting templates to cause service outages.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by monitoring for crashes of the Node.js process accompanied by a "JavaScript heap out of memory" error, which indicates excessive memory consumption caused by infinite recursive loops in LiquidJS templates.
Specifically, detection involves identifying if any submitted Liquid templates contain circular block references where a block with the same name is nested inside another block of the same name, triggering the recursion.
Commands to help detect this issue could include monitoring Node.js process logs for memory errors and using tools to analyze template submissions for nested blocks with identical names.
- Check Node.js process logs for the error message: "FATAL ERROR: JavaScript heap out of memory".
- Use process monitoring commands like `top`, `htop`, or `ps` to observe unusually high memory usage by Node.js processes.
- If possible, scan submitted Liquid templates for nested {% block %} tags with the same name inside each other, which can be done with custom scripts or template validation tools.
What immediate steps should I take to mitigate this vulnerability?
The immediate mitigation step is to upgrade the LiquidJS library to version 10.25.7 or later, where this vulnerability has been patched.
Until the upgrade can be applied, restrict or validate user-submitted Liquid templates to prevent circular block references that cause infinite recursion.
Additionally, monitor Node.js processes for memory usage and crashes to quickly detect exploitation attempts.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
CVE-2026-41311 is a Denial of Service (DoS) vulnerability in the LiquidJS library that allows any user who can submit a Liquid template to crash the Node.js process by causing an infinite recursive loop and memory exhaustion.
While the vulnerability severely impacts availability by enabling service disruption, there is no direct information provided about the exposure or compromise of personal data or sensitive information.
Therefore, the vulnerability primarily affects system availability, which could indirectly impact compliance with standards like GDPR or HIPAA if the affected service is critical for processing or protecting personal or health data.
However, no explicit details are given about data breaches or confidentiality impacts that would directly violate these regulations.