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

CVE-2026-114493: LocalAI SSRF Vulnerability

CVE-2026-114493 is a server-side request forgery flaw in LocalAI v4.6.0 through v4.11.0 that enables attackers to access internal resources. 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-114493 Overview

CVE-2026-114493 is a Server-Side Request Forgery (SSRF) vulnerability in LocalAI versions 4.6.0 through 4.11.0. The flaw resides in core/gallery/gallery.go, which validates only the initial gallery configuration URL submitted to the API. An attacker who sends a crafted URL to the POST /models/apply endpoint can trigger an HTTP redirect to an internal address, including cloud instance metadata services. The LocalAI HTTP client follows the redirect and returns the internal response as gallery content, exposing sensitive data to the unauthenticated caller. The weakness maps to CWE-918: Server-Side Request Forgery.

Critical Impact

Unauthenticated attackers can read cloud metadata credentials and internal network resources by abusing the LocalAI gallery endpoint as a redirect-driven SSRF proxy.

Affected Products

  • LocalAI v4.6.0
  • LocalAI versions between v4.6.0 and v4.11.0
  • LocalAI v4.11.0

Discovery Timeline

  • 2026-10-21 - CVE-2026-114493 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-114493

Vulnerability Analysis

LocalAI exposes a gallery feature that fetches model configuration files from URLs supplied by API callers. The guard logic in core/gallery/gallery.go inspects only the initial URL submitted by the user. Once validation passes, the request is handed to the shared HTTP client in pkg/httpclient/client.go, which follows HTTP 3xx redirects by default. The downloader in pkg/downloader/uri.go then treats the final response body as a legitimate gallery descriptor. Because the redirect target is never re-validated against the SSRF allowlist, an attacker-controlled web server can bounce the request to any address the LocalAI host can reach, including 169.254.169.254 on AWS, Azure, and GCP.

Root Cause

The SSRF guard performs single-point validation. It parses the initial URL, checks it against the policy, then delegates fetching to a client with redirect following enabled. No CheckRedirect callback re-applies the allowlist to the resolved Location header, so internal targets reached through redirects pass unchecked.

Attack Vector

An unauthenticated attacker hosts a public endpoint that returns HTTP 302 with a Location header pointing to an internal resource such as http://169.254.169.254/latest/meta-data/iam/security-credentials/. The attacker then issues a POST /models/apply request to the LocalAI server referencing the public URL. LocalAI validates the public URL, issues the GET, and follows the redirect to the metadata service. The response body, which may contain IAM credentials or internal service responses, is returned to the attacker as gallery content. See the VulnCheck Advisory for LocalAI and LocalAI Pull Request #12791 for the full exploitation path and fix.

Detection Methods for CVE-2026-114493

Indicators of Compromise

  • Outbound HTTP requests from the LocalAI host to RFC1918 ranges, link-local addresses such as 169.254.169.254, or metadata.google.internal.
  • Access log entries for POST /models/apply with gallery URLs pointing to attacker-controlled or newly registered domains.
  • Unexpected IAM credential usage originating from LocalAI workload roles immediately after gallery operations.

Detection Strategies

  • Alert on any process in the LocalAI container initiating connections to cloud metadata endpoints or internal management subnets.
  • Correlate /models/apply request bodies containing external URLs with subsequent DNS resolutions to internal zones.
  • Review web proxy or egress firewall logs for redirect chains that terminate at private IP space when initiated by LocalAI.

Monitoring Recommendations

  • Enable verbose logging on the LocalAI HTTP client to capture redirect targets and response sizes.
  • Monitor cloud audit logs (AWS CloudTrail, Azure Activity Log, GCP Audit Logs) for use of instance credentials outside normal patterns.
  • Baseline normal gallery URLs and flag deviations submitted through the API.

How to Mitigate CVE-2026-114493

Immediate Actions Required

  • Upgrade LocalAI to a release that includes LocalAI Pull Request #12791 once published past v4.11.0.
  • Restrict network egress from LocalAI hosts to deny traffic to 169.254.0.0/16, RFC1918 ranges, and other sensitive internal destinations.
  • Enforce IMDSv2 with hop-limit 1 on AWS and equivalent metadata hardening on Azure and GCP to blunt credential theft.
  • Place POST /models/apply behind authentication and network ACLs that limit callers to trusted operators.

Patch Information

The fix tracked in LocalAI Pull Request #12791 re-validates URLs on each redirect hop within the gallery and downloader flow. Review the LocalAI Gallery Source Code, LocalAI URI Downloader Source, and LocalAI HTTP Client Source to confirm your deployment includes the redirect validation changes.

Workarounds

  • Disable the gallery feature or block the /models/apply route at a reverse proxy until patched.
  • Deploy LocalAI inside a network namespace with no route to cloud metadata services or internal management planes.
  • Front LocalAI with an egress proxy that strips redirect responses targeting private address space.
bash
# Configuration example: block metadata and private ranges from the LocalAI container
iptables -A OUTPUT -d 169.254.169.254 -j REJECT
iptables -A OUTPUT -d 10.0.0.0/8 -j REJECT
iptables -A OUTPUT -d 172.16.0.0/12 -j REJECT
iptables -A OUTPUT -d 192.168.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.