Conversation
Cap proxied request bodies at 32 MiB (413 before routing), enforce the loopback-only local engine invariant, and fail closed when a peer certificate pin is missing. Signed-off-by: mkalkere <14184493+mkalkere@users.noreply.github.com>
Same three fixes as the Ollama proxy: 32 MiB request body cap with a 413 before routing, loopback-only local engine gate, and fail-closed peer transports when the certificate pin is absent. Signed-off-by: mkalkere <14184493+mkalkere@users.noreply.github.com>
Sequence and flow diagrams for the body cap, the loopback backend gate, and fail-closed peer TLS, plus a reading-order entry in the README. Signed-off-by: mkalkere <14184493+mkalkere@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hardens the request path shared by both inference proxies (
services/ollama-proxy,services/lmstudio-proxy): a loopback HTTP ingress plus a cluster mTLS ingress, ordered failover across node candidates, and model eligibility checks before routing. Three fixes, no behavior change for legitimate traffic, no JSON-RPC surface changes:handleHTTPbuffered the entire body (io.ReadAll) so failover attempts could replay it -- uncapped, so any loopback client could grow the proxy process until it OOMed.bufferBodyAndModelnow reads through aLimitReader; over-cap bodies get a413JSON error before candidate selection or any engine work.Scope
Included: P1+P2+P3 in both proxies,
proxy_hardening_test.goin both, version bumps,docs/proxy-request-hardening.mdx. Excluded: the proxies' loopback CORS posture and unpinned download paths -- deliberately left alone as separate concerns.Validation
go test -race ./...inservices/ollama-proxyandservices/lmstudio-proxy: pass.192.168.1.5,10.0.0.2,example.com,::ffff:192.168.1.5) refused;127.0.0.1/::1accepted; unpinned peer dial fails closed.go vetclean,gofmtclean,node scripts/spdx-headers.mjsreports 0 missing headers on every branch.services/testscross-process suite was not re-run: mDNS is blocked in this sandbox and those tests fail identically on pristine upstream.Risk
127.0.0.1; verified innvpair-ui-broker/advertiser.go.Checklist
git commit -s), certifying the Developer Certificate of Origin.services/versions.json, and described user-visible changes above so they reach the release notes.