Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Thumbor treats ALLOWED_SOURCES string patterns as unescaped regex, allowing hostname bypass via wildcard dot (CVE-2026-53500)

0
High
Published: 07/31/2026 (07/31/2026, 18:36:03 UTC)
Source: GCVE Database
Product: thumbor

Description

## Summary The `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. ## Affected component `thumbor/loaders/http_loader.py` — `validate()` ## Proof of concept ```python import re from thumbor.config import Config from thumbor.context import Context from thumbor.loaders import http_loader as loader config = Config() config.ALLOWED_SOURCES = ["s.glbimg.com"] # typical user config ctx = Context(None, config, None) # These should be blocked — both return True due to the unescaped dot print(loader.validate(ctx, "http://sXglbimgYcom/secret.jpg")) # True ← bypass print(loader.validate(ctx, "http://sAglbimg.com/secret.jpg")) # True ← bypass # Legitimate origin — correctly allowed print(loader.validate(ctx, "http://s.glbimg.com/logo.jpg")) # True ← correct ``` ## Root cause `thumbor/loaders/http_loader.py` (before fix): ```python for pattern in context.config.ALLOWED_SOURCES: if isinstance(pattern, Pattern): match = url else: pattern = f"^{pattern}$" # <-- dots not escaped, act as regex wildcard match = res.hostname if re.match(pattern, match): return True ``` ## Impact An attacker who can influence the image source URL passed to Thumbor can fetch images from arbitrary hosts, bypassing the `ALLOWED_SOURCES` allowlist. **Preconditions:** - `ALLOWED_SOURCES` contains at least one plain-string entry (the common case; all official documentation examples use plain strings). - 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. ## Fix Apply `re.escape()` to plain-string patterns before compiling them, so every character is matched literally: ```python else: pattern = f"^{re.escape(pattern)}$" # dots and other metacharacters are now literal match = res.hostname ``` This 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. The `ALLOWED_SOURCES` docstring in `config.py` was also updated to document the two-mode behaviour explicitly.

CVSS v3.1

Score 8.2high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L

Affected software

PyPIghsa
thumbor
Affected versions
<7.8.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/31/2026, 20:33:08 UTC

Technical Analysis

Thumbor's ALLOWED_SOURCES configuration is intended to restrict which hosts the HTTP loader fetches images from. However, plain-string entries in ALLOWED_SOURCES are passed directly to Python's re.match() without escaping metacharacters like the dot ('.'). Since '.' is a regex wildcard matching any character, this allows hostnames differing only at dot positions to bypass the allowlist. For example, 's.glbimg.com' matches 'sXglbimgYcom' or 'sAglbimg.com'. This undermines the SSRF protection ALLOWED_SOURCES is supposed to provide. The vulnerability affects Thumbor versions before 7.8.0. The fix is to apply re.escape() to plain-string patterns before matching, ensuring dots and other metacharacters are treated literally. Users requiring regex behavior can supply compiled regex patterns, which are unaffected by this issue.

Potential Impact

An attacker who can influence the image source URL passed to Thumbor can bypass the ALLOWED_SOURCES hostname restrictions and cause Thumbor to fetch images from arbitrary hosts. This breaks the primary SSRF defense mechanism. The vulnerability requires that ALLOWED_SOURCES contains at least one plain-string entry (the common case) and that the attacker can supply or influence the image URL, which is true when ALLOW_UNSAFE_URL is enabled (default) or when user input is forwarded to signed URL endpoints. The impact is high confidentiality loss (C:H), no integrity or availability impact, with no privileges or user interaction required.

Mitigation Recommendations

A patch is available that fixes this vulnerability by escaping plain-string ALLOWED_SOURCES entries before matching, preventing wildcard dot bypasses. Users should upgrade to Thumbor version 7.8.0 or later where this fix is applied. If upgrading is not immediately possible, users should ensure ALLOWED_SOURCES entries are provided as compiled regex patterns with explicit escaping. Review configurations to avoid relying on unescaped plain strings. There are no known exploits in the wild at this time.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-6x26-6r6f-m537
Osv Schema Version
1.4.0
Aliases
["CVE-2026-53500"]
Ecosystems
["PyPI"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a6cf7ddbf32cb7a342b1c73

Added to database: 07/31/2026, 19:30:37 UTC

Last enriched: 07/31/2026, 20:33:08 UTC

Last updated: 07/31/2026, 21:34:43 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses