security: harden network surface, filesystem, and hub IPC#9
Open
BRlin-o wants to merge 2 commits into
Open
Conversation
Network surface reduction (Phase 0): - Bind 127.0.0.1 by default; add HOST env for opt-in network access - Cap request body at 50 MB (CCXRAY_MAX_BODY_MB); return 413 on exceed - Per-IP SSE connection limit (default 8, CCXRAY_SSE_MAX_PER_IP) - HTTP timeouts: headersTimeout=60s, requestTimeout=120s, keepAliveTimeout=5s - Sanitize ANSI/control chars in logged request URLs (log injection) - Extract readBodyCapped() helper for safe body accumulation Filesystem hardening (Phase 1): - Log files 0o600, log directories 0o700; chmod on existing paths - safeJoin() rejects path traversal (../, /, \, null bytes) - Hub lockfile and log written with 0o600 Hub localhost-only + validation (Phase 2): - /_api/hub/* restricted to loopback IPs (127.0.0.1, ::1, ::ffff:127.0.0.1) - /_api/health remains open (pure liveness, no sensitive info) - Register/unregister validate pid (int, 0 < n ≤ 2²²) and cwd (string, ≤ 4096) - Hub body cap 1 KB for control endpoints BREAKING: Server now binds 127.0.0.1 only. Set HOST=0.0.0.0 for LAN access. Closes lis186#7 (partial) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bumps basic-ftp to patched version, resolving HIGH severity CRLF injection in @aws-sdk transitive dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Apr 17, 2026
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.
Summary
Security hardening for network/shared deployment scenarios. Part 1 of 3 PRs from the audit in #7.
Network surface reduction
127.0.0.1by default — previously0.0.0.0, exposing proxy + dashboard to the entire network. AddHOSTenv for opt-in LAN access.CCXRAY_MAX_BODY_MB), returns 413 on exceed. Prevents OOM via large POST.CCXRAY_SSE_MAX_PER_IP). Prevents connection exhaustion.headersTimeout=60s,requestTimeout=120s,keepAliveTimeout=5s. Mitigates slowloris.Filesystem hardening
0o600, directories0o700. Hub lockfile and log also0o600.safeJoin()rejects../,/,\, null bytes; verifies resolved path stays within base dir.Hub IPC isolation
/_api/hub/*restricted to127.0.0.1/::1/::ffff:127.0.0.1. Non-local requests get 403.pidmust be positive int ≤ 2²²,cwdmust be string ≤ 4096 chars, body capped at 1 KB./_api/healthremains open (pure liveness probe, no sensitive info).npm audit
npm audit fix— bumps basic-ftp to resolve HIGH CRLF injection in@aws-sdktransitive dep.Breaking change
Server now binds
127.0.0.1by default. Users accessing ccxray from other machines on the LAN need to setHOST=0.0.0.0.Test plan
storage-path-traversal.test.js(7 cases),fs-mode.test.js(4 cases),hub-loopback.test.js(12 cases)npx ccxray claudestarts and proxies correctlynpm audit --audit-level=high→ 0 vulnerabilitiesRef: #7
🤖 Generated with Claude Code