CVE-2026-59707
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 · uneditedLocalAI 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 confidenceLocalAI 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.
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 checksWork through these to decide whether this CVE applies to you.
-
Confirm LocalAI is running and accessibleIdentify 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.
-
Check the installed LocalAI versionQuery 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).
-
Verify if /models/apply endpoint is exposed without authenticationSend 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.
-
Inspect current URL validation or allowlist configurationExamine 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.
-
Confirm network exposure of the endpointDetermine 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.
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 · scopedImplement 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.
- Identify the affected LocalAI installation by locating the source code directory (typically /home/user/LocalAI or similar)
- Navigate to the LocalAI source directory: cd /path/to/localai
- Fetch the latest changes from the remote repository: git fetch origin
- Apply the specific security patch by cherry-picking commit f9b968e19d7cbc556d59dceb2e0e450b828a3fda using command: git cherry-pick f9b968e19d7cbc556d59dceb2e0e450b828a3fda
- After applying the patch, rebuild LocalAI from source: make build or follow project-specific build instructions
- Restart the LocalAI service to load the patched binary
- Verify the patch was applied correctly by checking git log or reviewing the modified code in the models/apply handler
- 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.
- Consultation3.0 h
- Implementation6.0 h
- Testing3.0 h
- Review / QA2.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-59707 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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