{"id":"CVE-2026-45017","aliases":["CVE-2026-45017","GHSA-8p4x-wr7x-3788","PYSEC-2026-192"],"related":[],"kind":"vulnerability","state":"published","title":"Python Liquid: Absolute paths escape filesystem loader search path","summary":"Python Liquid is a Python engine for the Liquid template language. Prior to 2.2.0, the built-in FileSystemLoader and CachingFileSystemLoader do not guard against reading files outside their search paths when given an absolute path to resolve. This allows malicious template authors to load and render arbitrary files via the {% include %} and {% render %} tags. Targeted files would need to contain valid Liquid markup and be readable by the application process. This vulnerability is fixed in 2.2.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Python Liquid is a Python engine for the Liquid template language. Prior to 2.2.0, the built-in FileSystemLoader and CachingFileSystemLoader do not guard against reading files outside their search paths when given an absolute path to resolve. This allows malicious template authors to load and render arbitrary files via the {% include %} and {% render %} tags. Targeted files would need to contain valid Liquid markup and be readable by the application process. This vulnerability is fixed in 2.2.0.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe built-in `FileSystemLoader` and `CachingFileSystemLoader` do not guard against reading files outside their search paths when given an absolute path to resolve. This allows malicious template authors to load and render arbitrary files via the `{% include %}` and `{% render %}` tags. Targeted files would need to contain valid Liquid markup and be readable by the application process.\n\n### Patches\nThe issue is fixed in version 2.2.0 with the inclusion of a `template_path.is_absolute()` condition in `liquid/builtin/loaders/file_system_loader.py`.\n\n```python\n        if os.path.pardir in template_path.parts or template_path.is_absolute():\n            raise TemplateNotFoundError(template_name)\n```\n\n### Workarounds\n\nCreate a custom template loader by inheriting from `FileSystemLoader` and overriding `resolve_path()`. Use an instance of the custom loader as the `loader` argument when instantiating your Liquid environment. \n\n```python\nimport os\nfrom pathlib import Path\n\nfrom liquid import Environment\nfrom liquid import FileSystemLoader\nfrom liquid.exceptions import TemplateNotFoundError\n\n\nclass MyFileSystemLoader(FileSystemLoader):\n    def resolve_path(self, template_name: str) -> Path:\n        template_path = Path(template_name)\n\n        if self.ext and not template_path.suffix:\n            template_path = template_path.with_suffix(self.ext)\n\n        if os.path.pardir in template_path.parts or template_path.is_absolute():\n            raise TemplateNotFoundError(template_name)\n\n        for path in self.search_path:\n            source_path = path.joinpath(template_path)\n            if not source_path.exists():\n                continue\n            return source_path\n\n        raise TemplateNotFoundError(template_name)\n\n\nenv = Environment(loader=MyFileSystemLoader(\"path/to/templates/\"))\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Python Liquid es un motor de Python para el lenguaje de plantillas Liquid. Antes de la versión 2.2.0, los cargadores integrados FileSystemLoader y CachingFileSystemLoader no impiden la lectura de archivos fuera de sus rutas de búsqueda cuando se les proporciona una ruta absoluta para resolver. Esto permite a autores de plantillas maliciosos cargar y renderizar archivos arbitrarios a través de las etiquetas {% include %} y {% render %}. Los archivos objetivo necesitarían contener marcado Liquid válido y ser legibles por el proceso de la aplicación. Esta vulnerabilidad está corregida en la versión 2.2.0.","source":"nvd"}],"published":"2026-05-11T14:57:43.000Z","modified":"2026-10-26T13:10:00.140Z","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"},{"scorer":"PyPA Advisory Database","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":"< 2.2.0","status":"affected"}],"vendor":"jg-rp","product":"liquid","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.0"}],"ecosystem":"PyPI","package":"python-liquid","purl":"pkg:pypi/python-liquid","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.2.0"}],"vendor":"jg-rp","product":"python_liquid","cpe":"cpe:2.3:a:jg-rp:python_liquid:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.0"}],"ecosystem":"PyPI","package":"python-liquid","purl":"pkg:pypi/python-liquid","source":"pysec"}],"references":[{"url":"https://github.com/jg-rp/liquid/security/advisories/GHSA-8p4x-wr7x-3788","tags":["advisory","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45017","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/jg-rp/liquid","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/python-liquid/PYSEC-2026-192.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-05-28T15:57:04.307Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45017","url":"https://www.cve.org/CVERecord?id=CVE-2026-45017","licence":"CVE Terms of Use","modified":"2026-05-28T15:57:12.837Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8p4x-wr7x-3788","url":"https://github.com/advisories/GHSA-8p4x-wr7x-3788","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:04.993Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45017","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45017","licence":"Public domain","modified":"2026-10-26T13:10:00.140Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-192","url":"https://osv.dev/vulnerability/PYSEC-2026-192","licence":"CC-BY-4.0","modified":"2026-06-03T12:45:18.117Z"}],"updatedAt":"2026-11-25T22:59:22.928Z","epss":{"score":0.00336,"percentile":0.28893,"date":"2026-12-01T12:00:22.000Z"}}