kbwall is designed as a least-privilege, read-only, air-gapped MCP firewall in front of local search engines (such as XERJ or Elasticsearch-compatible nodes).
- Zero
unsafeRust (#![forbid(unsafe_code)]): Enforced at compile time inCargo.toml. - Air-Gapped by Construction:
kbwallintentionally links zero TLS libraries and restricts engine traffic to loopback HTTP (127.0.0.1/localhost/::1) unlessengine.allow_non_loopback = trueis explicitly configured. DNS resolution validates that every resolved socket address is loopback before connecting (defeating DNS rebinding / dual-stack bypass). - Compile-Time Read-Only HTTP Client: The internal HTTP client only exposes
GETandPOST .../_search, validatesbase_pathand final request paths against traversal/query/fragment injection, and enforces strict response line/header/body size and wall-clock deadline caps. Write endpoints (PUT,DELETE,/_bulk,/_doc) cannot be invoked by the MCP server. - No Outbound Telemetry or PR Submission:
kbwallnever phones home, never registers feedback/PR tools in MCP, and always invokesxerj autoindexwith--disable-feedbackandXERJ_DISABLE_FEEDBACK=true. - Strict Path & Secret Confinement (
kb_search&kb_read): Immutable built-in secret exclusions (.env,.env.*,*.env,*.key,*.pem,*.p12,*.pfx,*.ppk,*secret*,*credential*,*token*.json/yml/yaml/toml, SSH private keys,.npmrc,.netrc,.pgpass,*.sqlite*,*.db*) plus user exclusions are enforced acrosskbwall sync,kb_searchhit normalization (dropping blocked or traversal paths before snippets leave the server), andkb_read(singleO_NOFOLLOW | O_NONBLOCKopen, canonical root confinement across nested sources with deny-wins semantics, 20 MiB file cap, and 128 KiB output cap). - Bounded MCP & Query Processing: Queries are length-capped and wildcard-escaped before entering Elasticsearch DSL; MCP stdio supports both NDJSON and
Content-Lengthframing with a 4 MiB frame cap.
Please report security issues privately via GitHub Security Advisories on wasabihu/kbwall rather than opening a public issue.