Severity:

HIGH RISK

(7.5)

SSRF in Lollms File Export Endpoint

CVE-2026-0560

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Internal network access and potential remote code execution via SSRF

Severity:

HIGH RISK

(7.5)

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

A Server-Side Request Forgery (SSRF) flaw in the /api/files/export-content endpoint of Lollms allows user-supplied URLs to be fetched by the server without proper validation.

In deployments where the Lollms backend can reach internal or cloud metadata networks, an attacker may leverage this behavior to access internal services, perform port scanning, exfiltrate metadata, and in some environments pivot toward remote code execution.

Affected context

The issue arises in Lollms instances that expose the /api/files/export-content API and allow users to provide arbitrary URLs for content export.

It is most impactful when:

  • The backend host has network connectivity to internal services (e.g., databases, admin panels, service meshes), and/or
  • The environment runs in cloud infrastructure where metadata endpoints are reachable from the instance,
  • Outbound egress traffic from the backend is unrestricted or only lightly filtered.

Under these conditions, the backend becomes an involuntary proxy into otherwise non-public network locations.

Exploit preconditions

  • Attack surface: HTTP API endpoint /api/files/export-content exposed to users or integrated services.
  • Required access: Ability to submit requests to this endpoint with attacker-controlled URL parameters (typically unauthenticated or authenticated user, depending on deployment).
  • Trigger point: The _download_image_to_temp() function in backend/routers/files.py is invoked with the supplied URL and issues outbound HTTP requests on behalf of the server.
  • Why exploitation is possible: The function does not sufficiently validate or restrict destination URLs (e.g., scheme, host, IP range, or metadata paths), allowing attackers to direct the server to contact arbitrary internal or external network locations.

Why this happens

This vulnerability stems from treating user-controlled URLs as trusted destinations for server-side HTTP requests.

The _download_image_to_temp() helper in backend/routers/files.py acts as a generic HTTP client without enforcing network-level or application-level egress restrictions.

No filtering is applied to prevent access to loopback, link-local, or private IP ranges, nor to known sensitive paths such as cloud provider metadata services.

This aligns with CWE-918: Server-Side Request Forgery (SSRF), where an application fetches remote resources based on untrusted input, unintentionally exposing its own network position, privileges, and trust boundaries.

Potential impact

  • Access to internal HTTP(S) services that are not directly exposed to the internet (e.g., admin panels, internal APIs, dashboards).
  • Interaction with cloud metadata endpoints, which may expose credentials, access tokens, and instance configuration.
  • Internal network mapping and port scanning by observing response behavior, errors, and timing.
  • Potential exploitation of internal services via the SSRF channel, which can in turn lead to remote code execution where vulnerable services are reachable.
  • Exfiltration of sensitive configuration data or service responses accessible only from the backend network.

General mitigation guidance

Effective mitigation focuses on strictly controlling server-initiated outbound requests and reducing trust in user-supplied URLs:

  • Introduce a positive-allowlist for outbound destinations, limiting requests to a small set of known-safe domains or hosts.
  • Validate URL schemes and reject non-HTTP/HTTPS schemes, as well as malformed or encoded URLs that might bypass filters.
  • Implement network-level egress controls (firewall rules, security groups) to prevent access to internal address ranges and metadata endpoints from the application host.
  • Normalize and parse URLs server-side, then resolve and verify the final destination IP against allowed ranges before making any request.
  • Where possible, decouple file retrieval from arbitrary URLs by using indirect references (e.g., object storage identifiers) instead of raw user URLs.
  • Apply least-privilege principles for the runtime environment so that, even if SSRF occurs, the backend has minimal access to internal assets and cloud privileges.

How teams detect issues like this

Organizations can use a mix of code-centric and operational approaches to detect SSRF risks:

  • Static analysis: Search for HTTP client usage (e.g., requests, httpx, urllib, or framework-specific clients) where the URL is derived from request parameters or other user-controlled input without prior validation or restriction.
  • Code review: Flag patterns where helper functions like _download_image_to_temp() accept arbitrary URLs and are reachable from public endpoints, especially when there is no allowlist, scheme filtering, or IP-range checks.
  • Security testing: Perform targeted SSRF tests against exposed endpoints by supplying URLs pointing to:
  • Reserved IP ranges (127.0.0.0/8, 10.0.0.0/8, 169.254.169.254, etc.)
  • Non-routable or invalid domains, observing response differences, timeouts, or error messages.
  • Runtime monitoring: Use network telemetry and logging to identify unusual outgoing requests from application nodes, such as connections to internal subnets or metadata services that should not be accessed.
  • Automated SAST and DAST tools can be configured to specifically highlight SSRF patterns in URL-handling functions and API routes.

Sources

SourceLink
github.comgithub.com/parisneo/lollms/commit/76a54f0df2df8a5b254aa627d487b5dc939a0263
huntr.comhuntr.com/bounties/65e43a5e-b902-4369-b738-1825285a3ea5

Frequently asked

questions

Yes. If the /api/files/export-content endpoint is reachable over the network, an attacker can remotely supply crafted URLs and cause the backend to initiate SSRF requests, subject to any authentication or access controls configured on the API.

The attacker needs the ability to call the vulnerable endpoint with a user-controlled URL parameter.

In some deployments this may be available to any authenticated user; in others it might be reachable anonymously, depending on how the API is exposed and protected.

The most robust pattern is to avoid making arbitrary outbound requests based directly on user input.

Where that is not feasible, enforce strict allowlists for destinations, validate and normalize URLs before use, block requests to internal and link-local IP ranges and metadata endpoints, and apply network-level egress restrictions around the application.

Establish secure design guidelines for any feature that performs server-side fetching of user-referenced resources:

  • Treat all user-controlled URLs as untrusted.
  • Require design and security review for new outbound-calling features.
  • Use automated checks in CI to flag patterns where HTTP client calls are parameterized by request data without appropriate validation.
  • Combine these practices with principle-of-least-privilege networking so that a single SSRF bug cannot reach sensitive internal systems.
Find out what's already
exploitable in your codebase.