v0.4.3-beta
π codebadger β v0.4.3-beta
v0.4.3-beta β security & deployment hardening. (The scalability/port-allocation and queue-depth fixes shipped in v0.4.2-beta.)
π Security
- SSRF-hardened repository URL validation. Remote repos are now restricted to
https://github.com/β¦andhttps://gitlab.com/β¦(incl.www.), enforced by two independent gates β a literal case-sensitivehttps://<host>/prefix match and a parsed-hostname allowlist. Rejects non-httpsschemes (git://,ssh://,file://), embedded credentials (user:tok@), non-default ports, control chars, userinfo host-smuggling (https://github.com@evil/β¦), internal/metadata hosts, and look-alike domains. - Snippet language validation + inference. Pasted code is supplied in
<code language="β¦">tags (regex-parsed); the language is validated and content-inferred, and a mislabeled or ambiguous snippet is refused with an actionable message instead of building a wrong-language CPG. CHAT_DEPLOYmode. SetCHAT_DEPLOY=trueto disablesource_type='local'entirely so a chat-facing / multi-tenant MCP can't read arbitrary host paths β callers must use an allowlisted repo URL or a pasted snippet.- Path-traversal hardening.
resolve_host_pathnow rejects null bytes / control characters, canonicalizes withrealpathbefore any check, and supports an optionalALLOWED_SOURCE_ROOTSallowlist for hard containment of local sources.
βοΈ Configuration & deployment
- New
MCP_PORTenv var (default4242). - Compose env passthrough fixed.
CHAT_DEPLOY,ALLOWED_SOURCE_ROOTS,CPG_QUEUE_MAXSIZE, andMCP_PORTare now passed into thecodebadger-mcpcontainer β previouslyCPG_QUEUE_MAXSIZEset in.envwas silently inert for the containerized MCP. .env/.env.examplesynced and documented for normal-user defaults.
π Docs
docs/security.md: SSRF/repo-URL allowlist, snippet-language,CHAT_DEPLOY, and path-confinement controls added to the threat model and hardening checklist.docs/deployment.md: new "Hardening a chat-facing deployment (CHAT_DEPLOY)" section.
Full changelog: v0.4.2-beta...v0.4.3-beta