CVE-2026-45017: python-liquid Absolute Paths Escape Filesystem Loader Vulnerability

HIGH
Advisory Identifier: GHSA-8p4x-wr7x-3788
CVSS 7.5
CWE-22
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-45017
GHSA Identifier GHSA-8p4x-wr7x-3788
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product python-liquid
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

python-liquid fixed: 2.2.0
pip install python-liquid>=2.2.0
Verify Direct and Transitive Dependencies

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

### Impact 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. ### Patches The 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`. ```python if os.path.pardir in template_path.parts or template_path.is_absolute(): raise TemplateNotFoundError(template_name) ``` ### Workarounds Create 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. ```python import os from pathlib import Path from liquid import Environment from liquid import FileSystemLoader from liquid.exceptions import TemplateNotFoundError class MyFileSystemLoader(FileSystemLoader): def resolve_path(self, template_name: str) -> Path: template_path = Path(template_name) if self.ext and not template_path.suffix: template_path = template_path.with_suffix(self.ext) if os.path.pardir in template_path.parts or template_path.is_absolute(): raise TemplateNotFoundError(template_name) for path in self.search_path: source_path = path.joinpath(template_path) if not source_path.exists(): continue return source_path raise TemplateNotFoundError(template_name) env = Environment(loader=MyFileSystemLoader("path/to/templates/")) ```

CVE-2026-45017 Affected python-liquid Versions

1 component(s)
Fixed Versions:
2.2.0
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?
CVE-2026-45017 is a security vulnerability in python-liquid involving Absolute paths escape filesystem loader search path under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which python-liquid versions are affected?
Affected versions include releases prior to 2.2.0 across affected packages: python-liquid.
What version fixes CVE-2026-45017?
Upgrading to 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is python-liquid affected?
Yes, python-liquid is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
What is the CVSS score of CVE-2026-45017?
CVE-2026-45017 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-45017?
CVE-2026-45017 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check PyPI dependencies for CVE-2026-45017?
Run the dependency tree command: 'pip show python-liquid'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}