CVE-2026-53502: Thumbor Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-cj54-hpcc-gj6h
CWE-22
Published
Advisory Summary

CVE-2026-53502 is a HIGH path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Thumbor libraries in the PyPI ecosystem. The issue involves thumbor has path traversal via post-validation url decoding bypass in file_loader. Remediation is available by upgrading affected packages to version 7.8.0.

CVE-2026-53502 at a Glance

CVE Identifier CVE-2026-53502
GHSA Identifier GHSA-cj54-hpcc-gj6h
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Thumbor
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-53502

To remediate this vulnerability, upgrade all affected Thumbor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

thumbor fixed: 7.8.0
pip install thumbor>=7.8.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 thumbor

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-53502, inspect your installed packages using pip:

pip show thumbor

Analyze the terminal output to locate any version of Thumbor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.8.0), your application is affected.

Note: The pip show thumbor 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 Thumbor, 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

The file_loader performs `unquote()` on the file path AFTER the `abspath() + startswith()` security check. An attacker can use percent-encoded path traversal sequences (`%2e%2e` for `..`) that pass the security check as literal directory names, but are then decoded to actual `..` traversal sequences. ## Affected code `thumbor/loaders/file_loader.py` lines 28-49: ```python async def load(context, path): file_path = join( context.config.FILE_LOADER_ROOT_PATH.rstrip("/"), path.lstrip("/") ) file_path = abspath(file_path) inside_root_path = file_path.startswith( # Security check abspath(context.config.FILE_LOADER_ROOT_PATH) ) result = LoaderResult() if not inside_root_path: result.error = LoaderResult.ERROR_NOT_FOUND result.successful = False return result if not exists(file_path): file_path = unquote(file_path) # unquote AFTER check! if exists(file_path) and isfile(file_path): with open(file_path, "rb") as source_file: ... ``` The watermark and frame filters pass their URL parameters directly to the loader without re-encoding (unlike the main image URL flow which applies `quote()` in `imaging.py` line 37). ## PoC ```bash # Read /etc/passwd via watermark filter path traversal # %252e is double-encoded: Tornado decodes to %2e, filter passes to file_loader, # file_loader unquote decodes %2e to . curl 'http://thumbor-host:8888/unsafe/filters:watermark(%252e%252e/%252e%252e/%252e%252e/%252e%252e/etc/passwd,0,0,100)/some-valid-image.jpg' ``` Flow: 1. `%252e%252e` arrives at Tornado, decoded to `%2e%2e` 2. Watermark filter passes `%2e%2e/%2e%2e/.../etc/passwd` to file_loader 3. `join(ROOT, '%2e%2e/...')` = `ROOT/%2e%2e/...` 4. `abspath()` sees `%2e%2e` as literal dir name (no dots to resolve) 5. `startswith(ROOT)` = True (passes check) 6. `exists()` returns False (literal `%2e%2e` dir doesn't exist) 7. `unquote()` converts `%2e%2e` to `..` 8. OS resolves `..` → reads files outside ROOT ## Prerequisites - `LOADER = thumbor.loaders.file_loader` (or `file_loader_http_fallback`) - `ALLOW_UNSAFE_URL = True` (this is the default) - watermark/frame filters are enabled by default (in BUILTIN_FILTERS) ## Impact Arbitrary file read on the thumbor server. When the file is a valid image format, its content is returned in the response overlaid as a watermark. Can be used to read configuration files, secrets, private keys, etc.

CVE-2026-53502 Affected Thumbor Versions

1 component(s)
Fixed Versions:
7.8.0
Product / Package Ecosystem Affected Versions Fixed Version
thumbor
PyPI
< 7.8.0
7.8.0

References

Frequently Asked Questions

What is CVE-2026-53502?
CVE-2026-53502 is a security vulnerability in Thumbor involving Thumbor has path traversal via post-validation URL decoding bypass in file_loader under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Thumbor versions are affected?
Affected versions include releases prior to 7.8.0 across affected packages: thumbor.
What version fixes CVE-2026-53502?
Upgrading to 7.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is thumbor affected?
Yes, thumbor is affected in releases prior to 7.8.0. Upgrade your dependency to 7.8.0 or later.
What CWE is associated with CVE-2026-53502?
CVE-2026-53502 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-53502?
Run the dependency tree command: 'pip show thumbor'. 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-cj54-hpcc-gj6h",
  "modified" : "2026-07-31T19:03:54Z",
  "published" : "2026-07-31T19:03:54Z",
  "aliases" : [ "CVE-2026-53502" ],
  "summary" : "Thumbor has path traversal via post-validation URL decoding bypass in file_loader",
  "details" : "The file_loader performs `unquote()` on the file path AFTER the `abspath() + startswith()` security check. An attacker can use percent-encoded path traversal sequences (`%2e%2e` for `..`) that pass the security check as literal directory names, but are then decoded to actual `..` traversal sequences.\n\n## Affected code\n\n`thumbor/loaders/file_loader.py` lines 28-49:\n```python\nasync def load(context, path):\n    file_path = join(\n        context.config.FILE_LOADER_ROOT_PATH.rstrip(\"/\"), path.lstrip(\"/\")\n    )\n    file_path = abspath(file_path)\n    inside_root_path = file_path.startswith(         # Security check\n        abspath(context.config.FILE_LOADER_ROOT_PATH)\n    )\n    result = LoaderResult()\n    if not inside_root_path:\n        result.error = LoaderResult.ERROR_NOT_FOUND\n        result.successful = False\n        return result\n\n    if not exists(file_path):\n        file_path = unquote(file_path)               # unquote AFTER check!\n\n    if exists(file_path) and isfile(file_path):\n        with open(file_path, \"rb\") as source_file:\n            ...\n```\n\nThe watermark and frame filters pass their URL parameters directly to the loader without re-encoding (unlike the main image URL flow which applies `quote()` in `imaging.py` line 37).\n\n## PoC\n\n```bash\n# Read /etc/passwd via watermark filter path traversal\n# %252e is double-encoded: Tornado decodes to %2e, filter passes to file_loader,\n# file_loader unquote decodes %2e to .\ncurl 'http://thumbor-host:8888/unsafe/filters:watermark(%252e%252e/%252e%252e/%252e%252e/%252e%252e/etc/passwd,0,0,100)/some-valid-image.jpg'\n```\n\nFlow:\n1. `%252e%252e` arrives at Tornado, decoded to `%2e%2e`\n2. Watermark filter passes `%2e%2e/%2e%2e/.../etc/passwd` to file_loader\n3. `join(ROOT, '%2e%2e/...')` = `ROOT/%2e%2e/...`\n4. `abspath()` sees `%2e%2e` as literal dir name (no dots to resolve)\n5. `startswith(ROOT)` = True (passes check)\n6. `exists()` returns False (literal `%2e%2e` dir doesn't exist)\n7. `unquote()` converts `%2e%2e` to `..`\n8. OS resolves `..` → reads files outside ROOT\n\n## Prerequisites\n\n- `LOADER = thumbor.loaders.file_loader` (or `file_loader_http_fallback`)\n- `ALLOW_UNSAFE_URL = True` (this is the default)\n- watermark/frame filters are enabled by default (in BUILTIN_FILTERS)\n\n## Impact\n\nArbitrary file read on the thumbor server. When the file is a valid image format, its content is returned in the response overlaid as a watermark. Can be used to read configuration files, secrets, private keys, etc.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "thumbor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.8.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.7.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thumbor/thumbor/security/advisories/GHSA-cj54-hpcc-gj6h"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thumbor/thumbor/commit/3b986d13677b30fe6651c8c72ebb25957ac0a40d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thumbor/thumbor"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thumbor/thumbor/releases/tag/7.8.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-31T19:03:54Z",
    "nvd_published_at" : null
  }
}