Server-Side Request Forgery (SSRF)Weakness · CWE-918

CVE-2026-59707

HIGH · 8.6 CVSS v3.1 Published 2026-07-07
Patch available
A vendor patch is available. No clean upgrade release — apply the published patch.
See remediation →
95/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click Patch available

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

LocalAI contains an unauthenticated SSRF vulnerability in the POST /models/apply endpoint where gallery URL fields are passed unsanitized to gallery.GetGalleryConfigFromURLWithContext. This allows unauthenticated attackers to force the server to issue HTTP GET requests to private/loopback IP ranges (e.g., 127.0.0.1), with partial response content leaked through error messages.

MitigationImplement strict URL validation and allowlist controls on the /models/apply endpoint to reject URLs pointing to private/loopback IP ranges, and add authentication requirements to the endpoint.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Confirm LocalAI is running and accessible
    Identify the LocalAI process or service and verify it is active. Check network listeners (e.g., netstat, ss, or container port mappings) to determine if port 8080 or the configured LocalAI port is exposed.
    Affected if LocalAI is running and the API port is reachable over the network.
  2. Check the installed LocalAI version
    Query the LocalAI instance version endpoint (e.g., GET /v1/info or /version) or inspect the binary/package version installed on the host.
    Affected if The installed version falls within any affected version range (compare to known vulnerable versions if available).
  3. Verify if /models/apply endpoint is exposed without authentication
    Send a POST request to /models/apply with a test gallery URL (e.g., http://127.0.0.1:9999/test) and observe if the server attempts the connection without returning an authentication error.
    Affected if The endpoint responds to unauthenticated requests and attempts to fetch the provided URL.
  4. Inspect current URL validation or allowlist configuration
    Examine LocalAI configuration files (YAML/JSON) for gallery-related settings, specifically any url_validation, allowed_urls, or gallery.allowlist configurations related to the /models/apply endpoint.
    Affected if No URL validation or allowlist is configured, or the configuration explicitly permits private/loopback IP ranges.
  5. Confirm network exposure of the endpoint
    Determine if the LocalAI service is bound to a non-loopback interface (0.0.0.0) and whether firewall rules or authentication protect the /models/apply endpoint from external access.
    Affected if The endpoint is accessible from untrusted networks without authentication or additional access controls.

A defender is affected if LocalAI is running with the /models/apply endpoint accessible to untrusted users without authentication and without URL validation blocking private/loopback IP addresses.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Patch available Apply the vendor patch
Vendor patch github.com →
Interim mitigation

Implement strict URL validation and allowlist controls on the /models/apply endpoint to reject URLs pointing to private/loopback IP ranges, and add authentication requirements to the endpoint.

Recommended fix Moderate confidence
  1. Identify the affected LocalAI installation by locating the source code directory (typically /home/user/LocalAI or similar)
  2. Navigate to the LocalAI source directory: cd /path/to/localai
  3. Fetch the latest changes from the remote repository: git fetch origin
  4. Apply the specific security patch by cherry-picking commit f9b968e19d7cbc556d59dceb2e0e450b828a3fda using command: git cherry-pick f9b968e19d7cbc556d59dceb2e0e450b828a3fda
  5. After applying the patch, rebuild LocalAI from source: make build or follow project-specific build instructions
  6. Restart the LocalAI service to load the patched binary
  7. Verify the patch was applied correctly by checking git log or reviewing the modified code in the models/apply handler
  8. Test that the /models/apply endpoint now properly validates and sanitizes gallery URLs before making requests

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing3.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,490
Get the patch applied

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,984.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-59707 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-59707 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data