{"id":"CVE-2026-30952","aliases":["CVE-2026-30952","GHSA-wmfp-5q7x-987x"],"related":[],"kind":"vulnerability","state":"published","title":"liquidjs has a path traversal fallback vulnerability","summary":"liquidjs is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.25.0, the 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. This vulnerability is fixed in 10.25.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"liquidjs is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.25.0, the 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. This vulnerability is fixed in 10.25.0.","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"liquidjs es un motor de plantillas compatible con Shopify / GitHub Pages en JavaScript puro. Antes de la versión 10.25.0, las etiquetas layout, render e include permiten el acceso arbitrario a archivos a través de rutas absolutas (ya sea como literales de cadena o a través de variables Liquid; estas últimas requieren dynamicPartials: true, que es el valor predeterminado). Esto plantea un riesgo de seguridad cuando se permite a usuarios malintencionados controlar el contenido de la plantilla o especificar la ruta del archivo a incluir como una variable Liquid. Esta vulnerabilidad se corrige en la versión 10.25.0.","source":"nvd"}],"published":"2026-03-10T01:04:34.000Z","modified":"2026-09-10T03:50:41.571Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 10.25.0","status":"affected"}],"vendor":"harttle","product":"liquidjs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"10.25.0"}],"ecosystem":"npm","package":"liquidjs","purl":"pkg:npm/liquidjs","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"10.25.0"}],"vendor":"liquidjs","product":"liquidjs","cpe":"cpe:2.3:a:liquidjs:liquidjs:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/harttle/liquidjs/security/advisories/GHSA-wmfp-5q7x-987x","tags":["mitigation","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/harttle/liquidjs/pull/851","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/harttle/liquidjs/pull/855","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/harttle/liquidjs/commit/3cd024d652dc883c46307581e979fe32302adbac","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30952","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/harttle/liquidjs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-03-11T14:39:07.165Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-30952","url":"https://www.cve.org/CVERecord?id=CVE-2026-30952","licence":"CVE Terms of Use","modified":"2026-03-11T14:39:22.286Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wmfp-5q7x-987x","url":"https://github.com/advisories/GHSA-wmfp-5q7x-987x","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:41.571Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-30952","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30952","licence":"Public domain","modified":"2026-06-17T10:33:12.823Z"}],"updatedAt":"2026-11-25T22:59:15.662Z","epss":{"score":0.00615,"percentile":0.50805,"date":"2026-12-01T12:00:22.000Z"}}