CVE-2026-35525: LiquidJS Root Restriction Bypass For Partial Vulnerability

HIGH
Advisory Identifier: GHSA-56p5-8mhr-2fph
CVSS 7.5
CWE-61
Published
Advisory Summary

CVE-2026-35525 is a HIGH (CVSS 7.5) root restriction bypass for partial vulnerability (CWE-61: UNIX Symbolic Link (Symlink) Following) affecting LiquidJS libraries in the npm ecosystem. The issue involves root restriction bypass for partial and layout loading through symlinked templates. Remediation is available by upgrading affected packages to version 10.25.3.

CVE-2026-35525 at a Glance

CVE Identifier CVE-2026-35525
GHSA Identifier GHSA-56p5-8mhr-2fph
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-61: UNIX Symbolic Link (Symlink) Following
Affected Product LiquidJS
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-35525

To remediate this vulnerability, upgrade all affected LiquidJS dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

liquidjs fixed: 10.25.3
npm install liquidjs@10.25.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls liquidjs

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-35525, inspect your project dependencies using npm:

npm ls liquidjs

Analyze the terminal output to locate any version of LiquidJS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.25.3), your application is affected.

Note: The npm ls liquidjs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-61: UNIX Symbolic Link (Symlink) Following, where the product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In LiquidJS, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary LiquidJS enforces partial and layout root restrictions using the resolved pathname string, but it does not resolve the canonical filesystem path before opening the file. A symlink placed inside an allowed partials or layouts directory can therefore point to a file outside that directory and still be loaded. ### Details For `{% include %}`, `{% render %}`, and `{% layout %}`, LiquidJS checks whether the candidate path is inside the configured partials or layouts roots before reading it. That check is path-based, not realpath-based. Because of that, a file like `partials/link.liquid` passes the directory containment check as long as its pathname is under the allowed root. If `link.liquid` is actually a symlink to a file outside the allowed root, the filesystem follows the symlink when the file is opened and LiquidJS renders the external target. So the restriction is applied to the path string that was requested, not to the file that is actually read. This matters in environments where an attacker can place templates or otherwise influence files under a trusted template root, including uploaded themes, extracted archives, mounted content, or repository-controlled template trees. ### PoC ```js const { Liquid } = require('liquidjs'); const fs = require('fs'); fs.rmSync('/tmp/liquid-root', { recursive: true, force: true }); fs.mkdirSync('/tmp/liquid-root', { recursive: true }); fs.writeFileSync('/tmp/secret-outside.liquid', 'SECRET_OUTSIDE'); fs.symlinkSync('/tmp/secret-outside.liquid', '/tmp/liquid-root/link.liquid'); const engine = new Liquid({ root: ['/tmp/liquid-root'] }); engine.parseAndRender('{% render "link.liquid" %}') .then(console.log); // SECRET_OUTSIDE ``` ### Impact If an attacker can place or influence symlinks under a trusted partials or layouts directory, they can make LiquidJS read and render files outside the intended template root. In practice this can expose arbitrary readable files reachable through symlink targets.

CVE-2026-35525 Affected LiquidJS Versions

1 component(s)
Fixed Versions:
10.25.3
Product / Package Ecosystem Affected Versions Fixed Version
liquidjs
npm
< 10.25.3
10.25.3

References

Frequently Asked Questions

What is CVE-2026-35525?
CVE-2026-35525 is a security vulnerability in LiquidJS involving Root restriction bypass for partial and layout loading through symlinked templates under CWE-61: UNIX Symbolic Link (Symlink) Following.
Which LiquidJS versions are affected?
Affected versions include releases prior to 10.25.3 across affected packages: liquidjs.
What version fixes CVE-2026-35525?
Upgrading to 10.25.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is liquidjs affected?
Yes, liquidjs is affected in releases prior to 10.25.3. Upgrade your dependency to 10.25.3 or later.
What is the CVSS score of CVE-2026-35525?
CVE-2026-35525 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-35525?
CVE-2026-35525 is classified under CWE-61: UNIX Symbolic Link (Symlink) Following (The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.).
How can I check npm dependencies for CVE-2026-35525?
Run the dependency tree command: 'npm ls liquidjs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-56p5-8mhr-2fph",
  "modified" : "2026-04-10T21:34:31Z",
  "published" : "2026-04-08T15:03:47Z",
  "aliases" : [ "CVE-2026-35525" ],
  "summary" : "LiquidJS: Root restriction bypass for partial and layout loading through symlinked templates",
  "details" : "### Summary\n\nLiquidJS enforces partial and layout root restrictions using the resolved pathname string, but it does not resolve the canonical filesystem path before opening the file. A symlink placed inside an allowed partials or layouts directory can therefore point to a file outside that directory and still be loaded.\n\n### Details\n\nFor `{% include %}`, `{% render %}`, and `{% layout %}`, LiquidJS checks whether the candidate path is inside the configured partials or layouts roots before reading it. That check is path-based, not realpath-based.\n\nBecause of that, a file like `partials/link.liquid` passes the directory containment check as long as its pathname is under the allowed root. If `link.liquid` is actually a symlink to a file outside the allowed root, the filesystem follows the symlink when the file is opened and LiquidJS renders the external target.\n\nSo the restriction is applied to the path string that was requested, not to the file that is actually read.\n\nThis matters in environments where an attacker can place templates or otherwise influence files under a trusted template root, including uploaded themes, extracted archives, mounted content, or repository-controlled template trees.\n\n### PoC\n\n```js\nconst { Liquid } = require('liquidjs');\nconst fs = require('fs');\n\nfs.rmSync('/tmp/liquid-root', { recursive: true, force: true });\nfs.mkdirSync('/tmp/liquid-root', { recursive: true });\n\nfs.writeFileSync('/tmp/secret-outside.liquid', 'SECRET_OUTSIDE');\nfs.symlinkSync('/tmp/secret-outside.liquid', '/tmp/liquid-root/link.liquid');\n\nconst engine = new Liquid({ root: ['/tmp/liquid-root'] });\n\nengine.parseAndRender('{% render \"link.liquid\" %}')\n  .then(console.log);\n// SECRET_OUTSIDE\n```\n\n### Impact\n\nIf an attacker can place or influence symlinks under a trusted partials or layouts directory, they can make LiquidJS read and render files outside the intended template root. In practice this can expose arbitrary readable files reachable through symlink targets.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "liquidjs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "10.25.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.25.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/harttle/liquidjs/security/advisories/GHSA-56p5-8mhr-2fph"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35525"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/harttle/liquidjs/pull/867"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/harttle/liquidjs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/harttle/liquidjs/releases/tag/v10.25.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-61" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-08T15:03:47Z",
    "nvd_published_at" : "2026-04-08T20:16:24Z"
  }
}