Repository navigation
Conversation
…erve Both local HTTP servers now reject POST bodies that are not declared application/json (415) and, when a request arrives on a loopback address, reject Host headers that do not name loopback (403). Regression tests in ruvllm/test/serve.test.js and kge/test/serve.test.mjs. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01MfPHVJTTBrgpQ4iP48A4r7
Owner
Author
|
The failing Generated by Claude Code |
This branch has not been deployed
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.
Daily security hardening for the local HTTP servers shipped by two npm packages.
Fixes
1.
npm/packages/ruvllm/bin/serve.js(ruvllm serve)content-type: application/json, or they get a 415 before the body is read. Requests that arrive on a loopback address must carry a loopbackHostheader (localhost,127.0.0.1or[::1], any port), or they get a 403. A server bound to a non-loopback address on purpose (--host 0.0.0.0) still answers LAN clients by any name.test/serve.test.jsPOST without a JSON content type is rejected and never reaches the enginerequests with a foreign Host header are rejected on loopbacknpm test: 162/162 pass afternpm run build.2.
npm/packages/kge/src/serve.ts(kge serve)src/node-shims.d.tsgains theheadersandsocketfields they need.test/serve.test.mjs, which uses the injected fake bindingserve: POST without a JSON content type is rejectedserve: a foreign Host header is rejected on loopbacknpm run buildandtsc --noEmit -p tsconfig.typetest.jsonpass. Ninenpm testfailures remain. They are the same onmain: they need the native or WASM binding, which is not built in this environment.Compatibility note
Clients that POST to either server without
content-type: application/jsonwill now get a 415. The OpenAI-compatible clients and@claude-flow/providersalready send that header.🤖 Generated with claude-flow
https://claude.ai/code/session_01MfPHVJTTBrgpQ4iP48A4r7
Generated by Claude Code