/

CVE-2026-53500

Severity:

HIGH RISK

(8.2)

Server-Side Request Forgery (CWE-918) in Thumbor

CVE-2026-53500

Received

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Bypass of hostname allowlists leading to SSRF

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Thumbor's ALLOWED_SOURCES hostname allowlist logic can be bypassed because plain strings are passed directly to re.match() without escaping dots, allowing similarly shaped hostnames to be treated as allowed.

Under deployments where ALLOWED_SOURCES is used to constrain where Thumbor may fetch images, an attacker can abuse this to reach unintended internal or external endpoints.

Affected context

This vulnerability appears in Thumbor instances that rely on the ALLOWED_SOURCES configuration to restrict where images can be fetched.

The issue manifests when operators specify hostnames or domain patterns in ALLOWED_SOURCES, and Thumbor uses re.match() with these values directly as regular expressions.

In such configurations, dots are treated as regex wildcards, so hostnames that differ at specific dot positions can still match the allowlist pattern in practice.

Exploit preconditions

  • Attack surface: HTTP interface of Thumbor, where users provide image URLs or paths.
  • Required access: Ability to supply or influence image source URLs processed by Thumbor (often unauthenticated or low-authenticated).
  • Trigger point: Thumbor's hostname validation against ALLOWED_SOURCES using re.match() before fetching the image.
  • Why exploitation is possible: ALLOWED_SOURCES entries are interpreted as raw regular expressions, causing dots and other characters to have regex semantics rather than literal hostname semantics. This allows crafted hostnames that look similar to allowed ones to pass the check and be fetched.

Why this happens

The underlying issue is a misuse of regular expressions for hostname allowlisting without proper escaping or clear distinction between patterns and literals.

ALLOWED_SOURCES entries are passed directly into re.match() as if they were literal hostnames, but in regex syntax a dot (.) means "any character," affecting how matches are evaluated.

This maps to CWE-918 (Server-Side Request Forgery), because the service trusts a flawed validation mechanism to control outbound requests, enabling attackers to redirect server-side fetches to unintended endpoints.

Potential impact

  • Thumbor can be tricked into making HTTP requests to internal services that were not intended to be reachable.
  • Attackers may be able to probe or exfiltrate data from internal HTTP endpoints accessible to Thumbor.
  • SSRF may be chained to further compromise, such as interacting with cloud metadata services.
  • Logging, monitoring, or billing systems may reflect unexpected outbound traffic originating from Thumbor.

General mitigation guidance

Effective mitigation focuses on treating hostnames as data, not as raw regular expressions, and on enforcing strong outbound request boundaries.

Recommended defensive patterns include:

  • Normalizing and parsing hostnames using URL/host parsing utilities, then performing exact or well-defined suffix/prefix comparisons rather than regex matches.
  • When pattern support is needed, using well-scoped matching (e.g., explicit domain suffix checks) and applying robust escaping so special characters do not gain unintended semantics.
  • Constraining outgoing requests at the network layer (firewalls, service meshes, or egress policies) so that even if logical checks fail, requests to sensitive internal ranges are blocked.
  • Running Thumbor with least-privilege network access, limiting reachable internal services and minimizing the blast radius of any SSRF.

How teams detect issues like this

Detection typically involves both code-level analysis and runtime monitoring:

  • Static analysis and configuration review to identify uses of re.match() or similar APIs where hostname or URL validation relies on unescaped patterns.
  • Code review practices that flag regex-based allowlists or blocklists for hostnames and encourage explicit parsing and comparison instead.
  • Policy enforcement within CI/CD pipelines that disallow or warn on regex use in security-critical validation logic.
  • Runtime monitoring for unusual outbound traffic patterns from Thumbor instances, such as unexpected internal IP ranges or metadata service access, which can indicate SSRF attempts.

Sources

SourceLink
github.comgithub.com/thumbor/thumbor/commit/68876715350c6c8f49c324e5515e64908830aed7
github.comgithub.com/thumbor/thumbor/releases/tag/7.8.0
github.comgithub.com/thumbor/thumbor/security/advisories/GHSA-6x26-6r6f-m537

Frequently asked

questions

It is broadly exploitable in environments where users can submit or control image URLs processed by Thumbor and where ALLOWED_SOURCES is relied upon to constrain destinations. In typical thumbnailing setups, this often means remote attackers can attempt SSRF if the service is reachable.

Attackers generally only need the ability to make requests to Thumbor's image processing endpoint with chosen URLs. This is frequently an unauthenticated or lightly authenticated capability in many deployments.

The safest approach is to stop treating hostnames as regular expressions. Parse URLs, extract hostnames, and compare them using strict, literal or clearly bounded domain matching. If pattern support is needed, design a constrained matching scheme that does not rely on raw regex semantics for critical validation.

Future systems should clearly separate user-controlled input from trust boundaries, avoid regex-based host validation, and enforce layered controls: robust hostname parsing, conservative allowlists, and network-level egress restrictions. Incorporating security reviews and automated checks for outbound request logic can further reduce SSRF risk.

Find out what's already
exploitable in your codebase.