CVE-2026-59707: LocalAI SSRF in models/apply endpoint

CVE-2026-59707 · Severity: high · CVSS 8.6 · Published 2026-07-07

LocalAI is an open-source AI engine that allows users to run various artificial intelligence models on their own hardware. A security flaw in the model installation process allows unauthenticated attackers to trick the server into making unauthorized requests to internal network resources. This could lead to the exposure of sensitive internal data or allow attackers to probe private infrastructure that is otherwise inaccessible from the internet.

Technologies: github.com/mudler/LocalAI (Go). Vendors: Go.

Quick answers

Is CVE-2026-59707 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-59707 being exploited in the wild.
How severe is CVE-2026-59707?
High severity, with a CVSS score of 8.6, published 7 July 2026.
Which products and versions are affected?
github.com/mudler/LocalAI (Go) < 1.40.1-0.20260703213242-2cbb3c96b34d, SEMVER:introduced=0,fixed=1.40.1-0.20260703213242-2cbb3c96b34d; LocalAI <= v4.3.1.
Is there a fix for CVE-2026-59707?
Yes. github.com/mudler/LocalAI (Go): upgrade to 1.40.1-0.20260703213242-2cbb3c96b34d or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-59707 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-59707?
Check whether you run github.com/mudler/LocalAI (Go) or LocalAI at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • github.com/mudler/LocalAI (Go): upgrade to 1.40.1-0.20260703213242-2cbb3c96b34d or later
    go get github.com/mudler/LocalAI@v1.40.1-0.20260703213242-2cbb3c96b34d

Technical details

A Server-Side Request Forgery (SSRF) vulnerability exists in LocalAI's 'POST /models/apply' endpoint due to insufficient validation of the 'url' field in the JSON request body. When the 'id' field is empty, the application passes the unsanitized URL directly to 'gallery.GetGalleryConfigFromURLWithContext', which performs an HTTP GET request using Go's http.Client. Because the application fails to verify if the target URL resolves to a public IP address, an unauthenticated remote attacker can force the server to scan or fetch data from internal loopback (127.0.0.1) or private network ranges. Furthermore, if the requested internal resource returns non-YAML content, the resulting error messages can leak approximately 30 bytes of the response body. The vulnerability is addressed in commit f9b968e.

Affected products

  • LocalAI LocalAI <= v4.3.1

Identifiers

  • CVE-2026-59707
  • GHSA-8c5q-hx4g-qq23
  • GO-2026-6645

Timeline

  • 2026-06-01: disclosed: Vulnerability reported to vendor via email
  • 2026-07-03: other: Public issue opened on GitHub repository
  • 2026-07-07: advisory: CVE-2026-59707 published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.