CVE-2026-45017: python-liquid Absolute Paths Escape Filesystem Loader Vulnerability
HIGHCVE-2026-45017 is a HIGH (CVSS 7.5) absolute paths escape filesystem loader vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting python-liquid libraries in the PyPI ecosystem. The issue involves absolute paths escape filesystem loader search path. Remediation is available by upgrading affected packages to version 2.2.0.
CVE-2026-45017 at a Glance
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).
How to Fix CVE-2026-45017
To remediate this vulnerability, upgrade all affected python-liquid dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install python-liquid>=2.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show python-liquid
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-45017, inspect your installed packages using pip:
pip show python-liquid
Analyze the terminal output to locate any version of python-liquid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.0), your application is affected.
Note: The pip show python-liquid command checks currently installed packages in your active Python environment.
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 python-liquid, 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-45017 Affected python-liquid Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
python-liquid
|
PyPI |
< 2.2.0
|
2.2.0
|
References
Frequently Asked Questions
What is CVE-2026-45017?
Which python-liquid versions are affected?
What version fixes CVE-2026-45017?
Is python-liquid affected?
What is the CVSS score of CVE-2026-45017?
What CWE is associated with CVE-2026-45017?
How can I check PyPI dependencies for CVE-2026-45017?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8p4x-wr7x-3788",
"modified" : "2026-06-09T02:00:21Z",
"published" : "2026-05-11T14:57:43Z",
"aliases" : [ "CVE-2026-45017" ],
"summary" : "python-liquid: Absolute paths escape filesystem loader search path",
"details" : "### 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```",
"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" : "PyPI",
"name" : "python-liquid"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jg-rp/liquid/security/advisories/GHSA-8p4x-wr7x-3788"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45017"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jg-rp/liquid"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/python-liquid/PYSEC-2026-192.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-11T14:57:43Z",
"nvd_published_at" : "2026-05-28T16:16:25Z"
}
}