---
id: CVE-2026-59707
title: LocalAI - Server-Side Request Forgery via POST /models/apply
summary: >-
  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
  galle…
severity: high
cvss: 8.6
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N'
cvssSource: cna
cwe:
  - CWE-918
vendor: LocalAI
product: LocalAI
affected:
  - LocalAI <= v4.3.1
ssvc:
  exploitation: poc
  automatable: 'yes'
  technicalImpact: partial
  timestamp: '2026-07-08T16:47:31.794452Z'
exploitAvailable: true
published: '2026-07-07'
updated: '2026-09-24'
sourceUpdated: '2026-09-24T14:18:02.507Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-59707'
references:
  - url: 'https://github.com/mudler/LocalAI/issues/10665'
    label: GitHub Issue
  - url: 'https://github.com/mudler/LocalAI'
    label: Product
  - url: >-
      https://github.com/mudler/LocalAI/commit/f9b968e19d7cbc556d59dceb2e0e450b828a3fda
    label: Patch Commit
  - url: >-
      https://www.vulncheck.com/advisories/localai-server-side-request-forgery-via-post-models-apply
tags:
  - cve.org
  - exploit-available
epss: 0.00482
epssPercentile: 0.38872
ingestedAt: '2026-09-24T15:45:56.724Z'
---

## Overview

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.

## Affected

- `LocalAI <= v4.3.1`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
