/

CVE-2026-45618

Severity:

CRITICAL RISK

(10.0)

Code Injection (CWE-94) in LiquidJS Template Engine

CVE-2026-45618

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical code injection vulnerability in LiquidJS allows crafted templates to execute arbitrary code when they are processed by the template engine. The issue becomes risky when untrusted users can create, modify, or submit templates for rendering in a privileged application context.

Affected context

The vulnerability can occur in applications that embed LiquidJS to render templates and permit template content to come from untrusted or insufficiently controlled sources. Risk increases when rendered templates have access to server-side objects, filesystem operations, network resources, credentials, or other privileged application capabilities.

Exploit preconditions

  • Attack surface: Applications or services that process LiquidJS templates
  • Required access: Ability to supply or modify template content, either directly or through an integrated content-management workflow
  • Trigger point: Rendering or compiling the crafted template
  • Why exploitation is possible: Template processing permits attacker-controlled expressions or constructs to reach executable behavior in the host runtime

Why this happens

The underlying issue is insufficient separation between template syntax and executable application behavior. When a template engine evaluates attacker-controlled constructs with access to unsafe runtime capabilities, template content can cross the intended data-and-presentation boundary and execute arbitrary code. This maps to CWE-94: Improper Control of Generation of Code, because untrusted input influences code-like behavior in the application process.

Potential impact

  • An attacker may execute arbitrary code in the application process
  • The application could be fully compromised under its runtime identity
  • Sensitive data, credentials, or configuration may be accessed
  • The attacker may alter generated content or application data
  • Compromise could enable lateral movement or service disruption

General mitigation guidance

Mitigation generally focuses on preventing untrusted template content from reaching execution-capable rendering paths.

Common defensive patterns include:

  • Treating templates as trusted application code rather than user data
  • Using a restricted rendering mode with an explicit, minimal allowlist of features
  • Removing access to host objects, filesystem APIs, process APIs, and network capabilities
  • Separating user-authored content from privileged server-side template rendering
  • Applying least-privilege permissions to the rendering process
  • Enforcing strict template validation and content policies before rendering
  • Isolating high-risk rendering in a constrained sandbox with limited resources

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis rules that flag template rendering of user-controlled strings
  • Code review checks for dynamic template compilation or evaluation
  • Inventory and policy controls for template engines used with untrusted content
  • Tests that verify restricted access to runtime objects and dangerous capabilities
  • Runtime monitoring for unexpected process, filesystem, network, or credential access by rendering services
  • Automated security review tools that identify data flowing from user input into template compilation or rendering APIs

Sources

SourceLink
github.comgithub.com/harttle/liquidjs/releases/tag/v10.26.0
github.comgithub.com/harttle/liquidjs/security/advisories/GHSA-gf2q-c269-pqgc

Frequently asked

questions

It can be remotely exploitable when a network-accessible application allows an attacker to submit or modify templates that are subsequently rendered on the server.

The attacker generally needs a path to influence template content. This may be unauthenticated or authenticated depending on the application's content-management and authorization controls.

Do not render untrusted templates with privileged capabilities. Use a restricted, allowlisted rendering model and isolate any unavoidable template processing from sensitive application resources.

Treat templates as executable code, enforce trust-boundary reviews, validate template sources, apply least privilege, and test that user-controlled content cannot access host runtime functionality.

Find out what's already
exploitable in your codebase.