CVE-2026-30952: Liquidjs Path Traversal Vulnerability
HIGHCVE-2026-30952 is a HIGH path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Liquidjs libraries in the npm ecosystem. The issue involves liquidjs has a path traversal fallback vulnerability. Remediation is available by upgrading affected packages to version 10.25.0.
CVE-2026-30952 at a Glance
How to Fix CVE-2026-30952
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.
npm install liquidjs@10.25.0
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-30952, 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.0), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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
CVE-2026-30952 Affected Liquidjs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
liquidjs
|
npm |
< 10.25.0
|
10.25.0
|
References
Frequently Asked Questions
What is CVE-2026-30952?
Which Liquidjs versions are affected?
What version fixes CVE-2026-30952?
Is liquidjs affected?
What CWE is associated with CVE-2026-30952?
How can I check npm dependencies for CVE-2026-30952?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wmfp-5q7x-987x",
"modified" : "2026-03-12T14:25:23Z",
"published" : "2026-03-10T01:04:34Z",
"aliases" : [ "CVE-2026-30952" ],
"summary" : "liquidjs has a path traversal fallback vulnerability",
"details" : "### Impact\nThe `layout`, `render`, and `include` tags allow arbitrary file access via absolute paths (either as string literals or through Liquid variables, the latter require `dynamicPartials: true`, which is the default). This poses a security risk when malicious users are allowed to control the template content or specify the filepath to be included as a Liquid variable.\n\n### Patches\nThe root cause is LiquidJS allows `require.resolve()` as fallback but doesn't limit the directories it can resolve to. The issue is fixed via [#855](https://github.com/harttle/liquidjs/pull/855) and published version 10.25.0 on npm.\n\n### Workarounds\n#### Change the files in build time\nIn build time, through Shell script or Webpack `string-replace-loader`, change the file content of correxponding file (depending on your package `type`, for CommonJS it's `dist/liquid.node.js`) under `dist/`, \n\n```diff\n if (fs.fallback !== undefined) {\n const filepath = fs.fallback(file)\n- if (filepath !== undefined) yield filepath\n+ if (filepath !== undefined) {\n+ for (const dir of dirs) {\n+ if (!enforceRoot || this.contains(dir, filepath)) {\n+ yield filepath\n+ break\n+ }\n+ }\n }\n }\n```\n\n#### Overriding by `fs` LiquidJS option\nAdding a [`fs` option](https://liquidjs.com/api/interfaces/FS.html) to override the [default `fs` implementation](https://github.com/harttle/liquidjs/blob/1b85fdaa9c535021f7030a239a64003af26d31b5/src/fs/fs-impl.ts#L36-L40):\n\n```javascript\nconst { statSync, readFileSync, promises: { stat, readFile } } = require('fs')\nconst { resolve, extname, dirname, sep } = require('path')\n\nconst fs = {\n exists: async (fp) => { try { await stat(fp); return true; } catch { return false } },\n existsSync: (fp) => { try { statSync(fp); return true } catch { return false } },\n resolve: (root, file, ext) => resolve(root, file + (extname(file) ? '' : ext)),\n contains: (root, file) => {\n const r = resolve(root)\n return file.startsWith(r.endsWith(sep) ? r : r + sep)\n },\n readFile: (fp) => readFile(fp, 'utf8'),\n readFileSync: (fp) => readFileSync(fp, 'utf8'),\n fallback: () => undefined,\n dirname,\n sep\n};\n\nconst engine = new Liquid({ fs })\n```\n\n### References\nDiscussions: https://github.com/harttle/liquidjs/pull/851\nCode fix: https://github.com/harttle/liquidjs/pull/855",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/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.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/harttle/liquidjs/security/advisories/GHSA-wmfp-5q7x-987x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-30952"
}, {
"type" : "WEB",
"url" : "https://github.com/harttle/liquidjs/pull/851"
}, {
"type" : "WEB",
"url" : "https://github.com/harttle/liquidjs/pull/855"
}, {
"type" : "WEB",
"url" : "https://github.com/harttle/liquidjs/commit/3cd024d652dc883c46307581e979fe32302adbac"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/harttle/liquidjs"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-10T01:04:34Z",
"nvd_published_at" : "2026-03-10T21:16:48Z"
}
}