Skip to content

security: daily hardening 2026-11-14 (request guards for ruvllm and kge local servers) - #1507

Draft
ruvnet wants to merge 1 commit into
mainfrom
claude/security-daily-2026-11-14
Draft

ruvnet wants to merge 1 commit into
mainfrom
claude/security-daily-2026-11-14

Conversation

@ruvnet

@ruvnet ruvnet commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Daily security hardening for the local HTTP servers shipped by two npm packages.

Fixes

1. npm/packages/ruvllm/bin/serve.js (ruvllm serve)

  • Class: cross-origin request forgery / DNS rebinding against a localhost API
  • Severity: MEDIUM
  • Change: POST requests must declare content-type: application/json, or they get a 415 before the body is read. Requests that arrive on a loopback address must carry a loopback Host header (localhost, 127.0.0.1 or [::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.
  • Validated by: test/serve.test.js
    • POST without a JSON content type is rejected and never reaches the engine
    • requests with a foreign Host header are rejected on loopback
    • The existing 413 test now sends a JSON content type.
    • Full npm test: 162/162 pass after npm run build.

2. npm/packages/kge/src/serve.ts (kge serve)

  • Class: same as above
  • Severity: LOW (the endpoints only read the model)
  • Change: the same two guards. src/node-shims.d.ts gains the headers and socket fields they need.
  • Validated by: new test/serve.test.mjs, which uses the injected fake binding
    • serve: POST without a JSON content type is rejected
    • serve: a foreign Host header is rejected on loopback
    • npm run build and tsc --noEmit -p tsconfig.typetest.json pass. Nine npm test failures remain. They are the same on main: 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/json will now get a 415. The OpenAI-compatible clients and @claude-flow/providers already send that header.

🤖 Generated with claude-flow

https://claude.ai/code/session_01MfPHVJTTBrgpQ4iP48A4r7


Generated by Claude Code

…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
@ruvnet ruvnet added the security-scan label Nov 14, 2026 — with Claude

ruvnet commented Nov 14, 2026

Copy link
Copy Markdown
Owner Author

The failing cargo deny (license + source + ban policy) check isn't caused by this PR. The failing section is advisories (RustSec advisories against the workspace Cargo.lock); bans, licenses and sources all pass. The same supply-chain workflow is red on main as of ed877ae (run). This PR changes only JavaScript/TypeScript under npm/packages/ruvllm and npm/packages/kge, and doesn't touch any Rust code or Cargo.lock. The open dependency PR #1506 appears to address part of the advisory backlog.


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants