Skip to main content
Vulnerability Database/CVE-2026-57569

CVE-2026-57569: Lychee Photo Management SSRF Vulnerability

CVE-2026-57569 is a server-side request forgery flaw in Lychee photo-management tool that allows DNS rebinding attacks to bypass SSRF protections. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-57569 Overview

CVE-2026-57569 is a Server-Side Request Forgery (SSRF) vulnerability in Lychee, a free, open-source photo-management tool. The flaw affects versions prior to 7.6.0 and stems from a Time-of-Check to Time-of-Use (TOCTOU) race condition [CWE-367] in the URL validation flow. The POST /api/v2/Photo::fromUrl endpoint validates a hostname in app/Rules/PhotoUrlRule.php, but the subsequent fetch in app/Image/Files/DownloadedFile.php resolves the hostname again through a separate fopen connection. An authenticated attacker who controls DNS responses can bypass the SSRF protections through DNS rebinding.

Critical Impact

Authenticated attackers controlling DNS responses can bypass SSRF validation to reach internal services available from the Lychee server.

Affected Products

  • Lychee photo-management tool, all versions prior to 7.6.0
  • Deployments exposing the Photo::fromUrl import endpoint to authenticated users
  • Instances where internal network services are reachable from the Lychee host

Discovery Timeline

  • 2026-10-15 - CVE-2026-57569 published to NVD
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2026-57569

Vulnerability Analysis

The vulnerability resides in the Lychee photo import workflow. When a user submits a URL to POST /api/v2/Photo::fromUrl, the application validates the hostname and its resolved IP addresses in app/Rules/PhotoUrlRule.php to confirm the target is a public address. The code then passes the original hostname string, not the validated IP, to app/Actions/Import/FromUrl.php and onward to app/Image/Files/DownloadedFile.php. The downstream handler opens an independent fopen connection that triggers a fresh DNS lookup, creating a TOCTOU window between validation and fetch.

Root Cause

The root cause is a classic Time-of-Check to Time-of-Use mismatch [CWE-367] in SSRF defenses. Validation and fetch perform independent name resolutions on the same hostname. The second resolution is trusted implicitly without re-validating the returned IP. This design assumption permits DNS rebinding to defeat the allowlist check.

Attack Vector

An authenticated attacker hosts a DNS server that returns a public IP during the first lookup to satisfy PhotoUrlRule validation. On the second lookup performed by fopen, the DNS server returns a private or otherwise forbidden address, such as 127.0.0.1, 169.254.169.254, or an internal RFC1918 range. The resulting request reaches services behind the Lychee server, subject to deployment topology and TLS behavior.

php
// Patch excerpt: app/Actions/Import/FromUrl.php
use App\Actions\Photo\Create;
use App\DTO\ImportMode;
use App\DTO\UrlValidatedDTO;
use App\Enum\UserUploadTrustLevel;
use App\Exceptions\Handler;
use App\Exceptions\MassImportException;
// Source: https://github.com/LycheeOrg/Lychee/commit/a5f23e314f1a933d31aa650616bf9cd84bd0407e

The patch introduces a UrlValidatedDTO to carry the validated resolution context from the rule into the fetch layer, eliminating the second independent DNS lookup.

Detection Methods for CVE-2026-57569

Indicators of Compromise

  • Repeated POST /api/v2/Photo::fromUrl requests referencing hostnames with short TTL DNS records.
  • Outbound HTTP requests from the Lychee server to RFC1918 ranges, loopback addresses, or cloud metadata endpoints such as 169.254.169.254.
  • Application logs showing successful URL validation followed by connection attempts to internal IP addresses.

Detection Strategies

  • Inspect DNS resolver logs for hostnames resolved by the Lychee host that return both public and private answers within a short time window.
  • Correlate authenticated user sessions submitting Photo::fromUrl requests with outbound network flows to non-internet destinations.
  • Review web server access logs for Photo::fromUrl calls that reference uncommon or newly registered domains.

Monitoring Recommendations

  • Monitor egress traffic from the Lychee server and alert on connections to internal subnets or metadata services.
  • Track the installed Lychee version across deployments and flag any instance below 7.6.0.
  • Enable DNS query logging on hosts running Lychee to retain evidence of rebinding behavior.

How to Mitigate CVE-2026-57569

Immediate Actions Required

  • Upgrade Lychee to version 7.6.0 or later, which fixes the TOCTOU resolution bypass.
  • Restrict outbound network access from the Lychee server to only the destinations required for photo imports.
  • Review authenticated user accounts and remove unused or untrusted upload permissions.

Patch Information

The fix is available in the Lychee v7.6.0 Release. Technical details are documented in GitHub Security Advisory GHSA-vj35-v9x5-vrxh, with the code change in commit a5f23e3 and discussion in Pull Request #4344. The patch introduces a UrlValidatedDTO so the validated resolution is carried through to the fetch step.

Workarounds

  • Place the Lychee server behind an egress proxy that enforces IP allowlisting and blocks RFC1918, loopback, and cloud metadata ranges.
  • Disable the URL-based photo import feature if it is not required by users.
  • Restrict the Photo::fromUrl endpoint to a limited set of trusted authenticated users via network-layer controls.
bash
# Example egress filter: block internal and metadata destinations from Lychee host
iptables -A OUTPUT -m owner --uid-owner www-data -d 127.0.0.0/8 -j REJECT
iptables -A OUTPUT -m owner --uid-owner www-data -d 10.0.0.0/8 -j REJECT
iptables -A OUTPUT -m owner --uid-owner www-data -d 172.16.0.0/12 -j REJECT
iptables -A OUTPUT -m owner --uid-owner www-data -d 192.168.0.0/16 -j REJECT
iptables -A OUTPUT -m owner --uid-owner www-data -d 169.254.0.0/16 -j REJECT

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.