localai-bench-2026-07-08
Request-auth path matching lacks segment boundaries / positive allowlist (hardening); further findings under coordinated disclosure
What was found
AntFleet's two-model consensus review (Claude Opus 4.7 + GPT-5.5) ran against a curated mirror of [mudler/LocalAI](https://github.com/mudler/LocalAI)'s authentication surface — request auth (API keys / middleware / permissions), identity (OAuth / session / password), and untrusted-input handling.
MEDIUM — request-auth path matching lacks segment boundaries and a positive allowlist
isAPIPath in core/http/auth/middleware.go classifies routes as "API" (auth-required) using strings.HasPrefix checks without trailing slashes (e.g. /tts, /vad, /video, /system, /completions, /embeddings, /messages, /responses). Prefix matching without a segment boundary means a future route such as /systemabc would match, and — more importantly — the design relies on an allow-by-default posture rather than a positive UI/static allowlist with deny-by-default for everything else. As new routes are added, a missed entry can silently pass unauthenticated. The current tree appears safe (no overlapping routes exist today); this is a hardening / defense-in-depth finding.
Recommendation: invert the check to require auth for everything except an explicit UI/static allowlist, and use segment-boundary matching for any prefix comparisons.
Additional findings — coordinated disclosure
Higher-severity authentication findings from the same review were reported privately to security@localai.io on 2026-07-08, following LocalAI's SECURITY.md coordinated-disclosure policy. Details are withheld from this public receipt until LocalAI has addressed them, at which point this page will be updated with the full write-ups and fix references.
Evidence
- Reviewed surface:
core/http/auth/*,core/http/endpoints/localai/cors_proxy.go,pkg/utils/{urlfetch,untar,path}.go - MEDIUM finding location: [
core/http/auth/middleware.go](https://github.com/mudler/LocalAI/blob/master/core/http/auth/middleware.go) —isAPIPath - Coordinated disclosure channel: security@localai.io (per SECURITY.md)
- Methodology: two-model unanimous consensus (Claude Opus 4.7 + GPT-5.5). Benchmark mirror is private during coordinated disclosure.