Description
LocalAI contains an unauthenticated server-side request forgery vulnerability in the POST /models/apply endpoint that allows attackers to fetch arbitrary internal URLs. The endpoint passes unsanitized gallery URL fields directly to gallery.GetGalleryConfigFromURLWithContext without proper validation, enabling attackers to force the server to issue HTTP GET requests to private and loopback ranges with partial response content leaked through error messages.
Published: 2026-07-07
Score: 9.2 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The LocalAI platform contains an unauthenticated server‑side request forgery flaw that is triggered by sending a POST request to the /models/apply endpoint with an unsanitized gallery URL field. The server forwards that URL to the gallery.GetGalleryConfigFromURLWithContext function without validation, causing it to private or loopback ranges. Error messages return a fragment of the response body, allowing attackers to retrieve internal data and exploit confidential information, as described by CWE‑918.

Affected Systems

The vulnerability is present in all installations of LocalAI that have not applied the fix introduced in commit f9 or later. No explicit version range is listed, so any deployment that has the unpatched code is considered vulnerable.

Risk and Exploitability

With a CVSS score of 9.2 the issue is classified as critical, while the EPSS score of less than 1% indicates a low but non‑zero exploitation probability. The endpoint is publicly reachable without authentication, increasing the attack surface. The flaw is not listed in CISA’s KEV catalog. Attackers can exploit it simply by sending a crafted POST to /models/apply with a gallery URL pointing to an internal or loopback service; the server issues the request and leaks part of the response, enabling information disclosure.

Generated by OpenCVE AI on July 26, 2026 at 19:03 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade version that includes the patch commit f9b968e or later.
  • If an immediate upgrade is not possible, block outbound traffic to private and loopback CIDR ranges from the /models/apply endpoint using firewall or reverse‑proxy rules.
  • Restrict access to the /models/apply endpoint by requiring authentication, preventing unauthenticated exploitation.

Generated by OpenCVE AI on July 26, 2026 at 19:03 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 14 Jul 2026 22:30:00 +0000

Type Values Removed Values Added
First Time appeared Mudler
Mudler localai
CPEs cpe:2.3:a:mudler:localai:*:*:*:*:*:*:*:*
Vendors & Products Mudler
Mudler localai

Fri, 10 Jul 2026 10:15:00 +0000

Type Values Removed Values Added
First Time appeared Localai
Localai localai
Vendors & Products Localai
Localai localai

Wed, 08 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 07 Jul 2026 21:00:00 +0000

Type Values Removed Values Added
Description LocalAI contains an unauthenticated server-side request forgery vulnerability in the POST /models/apply endpoint that allows attackers to fetch arbitrary internal URLs. The endpoint passes unsanitized gallery URL fields directly to gallery.GetGalleryConfigFromURLWithContext without proper validation, enabling attackers to force the server to issue HTTP GET requests to private and loopback ranges with partial response content leaked through error messages.
Title LocalAI - Server-Side Request Forgery via POST /models/apply
Weaknesses CWE-918
References
Metrics cvssV3_1

{'score': 8.6, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N'}

cvssV4_0

{'score': 9.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-20T17:46:00.654Z

Reserved: 2026-07-06T15:31:46.187Z

Link: CVE-2026-59707

cve-icon Vulnrichment

Updated: 2026-07-08T16:47:46.558Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-26T19:15:03Z

Weaknesses
  • CWE-918

    Server-Side Request Forgery (SSRF)