{"id":"CVE-2026-53500","aliases":["CVE-2026-53500","GHSA-6x26-6r6f-m537","PYSEC-2026-3617"],"related":[],"kind":"vulnerability","state":"published","title":"Thumbor treats ALLOWED_SOURCES string patterns as unescaped regex, allowing hostname bypass via wildcard dot","summary":"Thumbor is an open-source photo thumbnail service by globo.com. Prior to 7.8.0, the ALLOWED_SOURCES configuration passes plain strings to re.match() without escaping dots, so a hostname differing at dot positions can match the allowlist. 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, the ALLOWED_SOURCES configuration passes plain strings to re.match() without escaping dots, so a hostname differing at dot positions can match the allowlist. This issue is fixed in 7.8.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe `ALLOWED_SOURCES` configuration is meant to restrict which hosts Thumbor's HTTP loader may fetch images from. Plain-string entries in that list (the overwhelming majority of real-world and documented configurations) are passed directly to `re.match()` without escaping. Because `.` is a regex wildcard, every dot in a domain name becomes a bypass vector: `s.glbimg.com` silently matches `sXglbimgYcom`, `sAglbimg.com`, and any other hostname that differs only at a dot position. This undermines the primary SSRF defence that `ALLOWED_SOURCES` is intended to provide.\n\n## Affected component\n\n`thumbor/loaders/http_loader.py` — `validate()`\n\n## Proof of concept\n\n```python\nimport re\nfrom thumbor.config import Config\nfrom thumbor.context import Context\nfrom thumbor.loaders import http_loader as loader\n\nconfig = Config()\nconfig.ALLOWED_SOURCES = [\"s.glbimg.com\"]   # typical user config\nctx = Context(None, config, None)\n\n# These should be blocked — both return True due to the unescaped dot\nprint(loader.validate(ctx, \"http://sXglbimgYcom/secret.jpg\"))  # True ← bypass\nprint(loader.validate(ctx, \"http://sAglbimg.com/secret.jpg\"))  # True ← bypass\n\n# Legitimate origin — correctly allowed\nprint(loader.validate(ctx, \"http://s.glbimg.com/logo.jpg\"))    # True ← correct\n```\n\n## Root cause\n\n`thumbor/loaders/http_loader.py` (before fix):\n\n```python\nfor pattern in context.config.ALLOWED_SOURCES:\n    if isinstance(pattern, Pattern):\n        match = url\n    else:\n        pattern = f\"^{pattern}$\"   # <-- dots not escaped, act as regex wildcard\n        match = res.hostname\n\n    if re.match(pattern, match):\n        return True\n```\n\n## Impact\n\nAn attacker who can influence the image source URL passed to Thumbor can fetch images from arbitrary hosts, bypassing the `ALLOWED_SOURCES` allowlist.\n\n**Preconditions:**\n\n- `ALLOWED_SOURCES` contains at least one plain-string entry (the common case; all official documentation examples use plain strings).\n- The attacker can supply or influence the image URL — true whenever  `ALLOW_UNSAFE_URL = True` (the default), or when the application forwards user input to a signed URL endpoint.\n\n## Fix\n\nApply `re.escape()` to plain-string patterns before compiling them, so every\ncharacter is matched literally:\n\n```python\nelse:\n    pattern = f\"^{re.escape(pattern)}$\"   # dots and other metacharacters are now literal\n    match = res.hostname\n```\n\nThis is a one-call addition with no breaking change for correctly written configurations. Users who need real regular-expression behaviour should supply a compiled pattern (`re.compile(r\"s\\.glbimg\\.com\")`), which is already handled by the existing `isinstance(pattern, Pattern)` branch and is unaffected by this change.\n\nThe `ALLOWED_SOURCES` docstring in `config.py` was also updated to document the two-mode behaviour explicitly.","format":"markdown","source":"ghsa"}],"published":"2026-07-31T18:35:54.234Z","modified":"2026-09-08T20:51:43.490Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L","score":8.2,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L","score":8.2,"rating":"HIGH"}],"cwes":["CWE-918","CWE-1333"],"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-6x26-6r6f-m537","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/thumbor/thumbor/commit/68876715350c6c8f49c324e5515e64908830aed7","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-6x26-6r6f-m537","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53500","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-31T23:29:34.062Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53500","url":"https://www.cve.org/CVERecord?id=CVE-2026-53500","licence":"CVE Terms of Use","modified":"2026-07-31T23:30:44.046Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6x26-6r6f-m537","url":"https://github.com/advisories/GHSA-6x26-6r6f-m537","licence":"CC-BY-4.0","modified":"2026-08-04T14:40:34.274Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53500","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53500","licence":"Public domain","modified":"2026-09-08T20:51:43.490Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3617","url":"https://osv.dev/vulnerability/PYSEC-2026-3617","licence":"CC-BY-4.0","modified":"2026-08-04T14:30:30.167Z"}],"updatedAt":"2026-11-25T22:59:30.732Z","epss":{"score":0.00498,"percentile":0.35615,"date":"2026-11-30T12:00:22.000Z"}}