CVE-2026-45017
Path Traversal in Python Liquid Template Engine
Publication date: 2026-05-28
Last updated on: 2026-05-28
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | 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. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-45017 is a high-severity vulnerability in the Python package python-liquid, specifically affecting versions prior to 2.2.0.
The vulnerability arises because the FileSystemLoader and CachingFileSystemLoader components do not properly restrict file access when given absolute paths.
This flaw allows malicious template authors to bypass intended filesystem boundaries and load arbitrary files using the Liquid template language's {% include %} and {% render %} tags.
However, the targeted files must contain valid Liquid markup and be readable by the application process for the exploit to succeed.
The issue is classified as a path traversal vulnerability (CWE-22) and was fixed in version 2.2.0 by adding checks against absolute paths in the loader's resolution logic.
How can this vulnerability impact me? :
This vulnerability can allow an attacker who can author malicious templates to read and render arbitrary files on the server.
Such unauthorized file access can lead to exposure of sensitive information contained in those files if they include valid Liquid markup and are accessible by the application.
This could result in data leakage, unauthorized disclosure of configuration files, credentials, or other critical data.
The impact depends on the files accessible and the privileges of the application process.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability involves the Python package python-liquid versions prior to 2.2.0, specifically in the FileSystemLoader and CachingFileSystemLoader components that allow reading files outside their intended search paths when given absolute paths.
To detect if your system is vulnerable, first check the installed version of python-liquid by running the command:
- pip show python-liquid
If the version is earlier than 2.2.0, your system is vulnerable.
Additionally, you can audit your codebase or templates for usage of the {% include %} and {% render %} tags that might be passing absolute paths to the loaders.
There are no specific network detection commands provided, as this is a local template engine vulnerability, but reviewing logs or application behavior for unexpected file reads or template rendering errors involving absolute paths may help.
What immediate steps should I take to mitigate this vulnerability?
The primary immediate mitigation step is to upgrade the python-liquid package to version 2.2.0 or later, where the vulnerability is fixed.
If upgrading is not immediately possible, you can implement a custom loader by overriding the resolve_path() method in FileSystemLoader or CachingFileSystemLoader to enforce stricter path validation and prevent absolute path resolution outside the intended directories.
Avoid using absolute paths in the {% include %} and {% render %} tags in your templates until the fix is applied.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability in Python Liquid allows malicious template authors to read arbitrary files outside the intended search paths. This unauthorized file access could lead to exposure of sensitive data if such files contain personal or protected information.
Such exposure may impact compliance with data protection regulations like GDPR and HIPAA, which require strict controls over access to personal and sensitive data. If an attacker exploits this vulnerability to access protected files, it could result in a breach of confidentiality obligations under these standards.
Mitigating this vulnerability by upgrading to version 2.2.0 or implementing stricter path validation is essential to maintain compliance and reduce the risk of unauthorized data disclosure.