{"id":"CVE-2026-35525","aliases":["CVE-2026-35525","GHSA-56p5-8mhr-2fph"],"related":[],"kind":"vulnerability","state":"published","title":"LiquidJS has a root restriction bypass for partial and layout loading through symlinked templates","summary":"LiquidJS is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.25.3, 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. This vulnerability is fixed in 10.25.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"LiquidJS is a Shopify / GitHub Pages compatible template engine in pure JavaScript. Prior to 10.25.3, 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. This vulnerability is fixed in 10.25.3.","source":"cvelist"},{"lang":"en","text":"### 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.","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.3, para {% include %}, {% render %} y {% layout %}, LiquidJS verifica si la ruta candidata está dentro de las raíces de parciales o diseños configuradas antes de leerla. Esa verificación se basa en la ruta, no en la ruta real. Debido a eso, un archivo como partials/link.liquid pasa la verificación de contención de directorio siempre que su nombre de ruta esté bajo la raíz permitida. Si link.liquid es en realidad un enlace simbólico a un archivo fuera de la raíz permitida, el sistema de archivos sigue el enlace simbólico cuando se abre el archivo y LiquidJS renderiza el objetivo externo. Así, la restricción se aplica a la cadena de ruta que fue solicitada, no al archivo que realmente se lee. Esto importa en entornos donde un atacante puede colocar plantillas o influir de otra manera en archivos bajo una raíz de plantilla de confianza, incluyendo temas subidos, archivos extraídos, contenido montado o árboles de plantillas controlados por repositorio. Esta vulnerabilidad se corrige en la versión 10.25.3.","source":"nvd"}],"published":"2026-04-08T15:03:47.000Z","modified":"2026-09-10T03:50:42.921Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","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"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","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-61"],"affected":[{"ranges":[{"version":"< 10.25.3","status":"affected"}],"vendor":"harttle","product":"liquidjs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"10.25.3"}],"ecosystem":"npm","package":"liquidjs","purl":"pkg:npm/liquidjs","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"10.25.3"}],"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-56p5-8mhr-2fph","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/harttle/liquidjs/pull/867","tags":["issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/harttle/liquidjs/releases/tag/v10.25.3","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35525","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/harttle/liquidjs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-04-08T19:52:53.691Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-35525","url":"https://www.cve.org/CVERecord?id=CVE-2026-35525","licence":"CVE Terms of Use","modified":"2026-04-08T19:53:00.573Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-56p5-8mhr-2fph","url":"https://github.com/advisories/GHSA-56p5-8mhr-2fph","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:42.921Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-35525","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35525","licence":"Public domain","modified":"2026-07-24T21:10:00.143Z"}],"updatedAt":"2026-11-25T22:59:18.305Z","epss":{"score":0.00412,"percentile":0.3756,"date":"2026-12-01T12:00:22.000Z"}}