This document tracks security hardening measures implemented in Super-MCP.
See also: Rebel Safety System - Parent app safety and security architecture
-
Localhost Binding (
server.ts,callbackServer.ts)- HTTP server binds to
127.0.0.1only (not0.0.0.0) - Prevents remote network access to local MCP server
- HTTP server binds to
-
Command Injection Prevention (
providers/simple.ts)- Browser launch uses
spawn()instead ofexec() - Eliminates shell metacharacter injection risk
- Browser launch uses
-
File Permission Hardening (
simple.ts,cli.ts,logging.ts)- Directories created with mode
0o700 - Files created with mode
0o600 - Applies to token storage, config files, and logs
- Directories created with mode
-
PKCE Validation (
providers/simple.ts)- Throws error if code verifier missing (previously returned dummy value)
- Ensures OAuth PKCE flow integrity
-
Tool Argument Validation Ordering (
handlers/useTool.ts)- Validation happens BEFORE dry_run check
- Ensures all tool executions are validated
-
ReDoS Protection (
security.ts)- Uses
safe-regex2to validate user-defined regex patterns - Rejects patterns vulnerable to catastrophic backtracking
- MAX_PATTERN_LENGTH = 500 chars
- MAX_INPUT_LENGTH = 100 chars for tool/package names
- Handles RegExp g/y flag statefulness
- Uses
-
Log Redaction (
logging.ts)- Detects URLs anywhere in log values (not just at string start)
- Redacts sensitive query params: token, key, secret, password, code, access_token, refresh_token, client_secret, api_key, apikey
- Case-insensitive parameter matching
- Redacts URL fragments (#access_token=...)
- Redacts userinfo (user:password@host)
-
OAuth State Parameter (
providers/simple.ts,callbackServer.ts,authenticate.ts)- Implements
state()method with 256-bit cryptographic entropy - Callback server validates state with timing-safe comparison
- Prevents login CSRF attacks
- Implements
-
DNS Rebinding Protection (
server.ts)- Host header validation on
/mcpendpoint - Rejects requests with Host != localhost/127.0.0.1
- Case-insensitive matching per RFC 7230
- Host header validation on
Issue: TOCTOU race between port availability check and binding.
Status: Deferred - fix would break OAuth redirect_uri flow.
Rationale: The retry mechanism would cause port to change after OAuth provider registration, breaking callbacks. Needs OAuth flow restructuring which is invasive.
Risk: Low - window is tiny and attack requires precise timing + local process.
Issue: HTTP /mcp endpoint has no authentication.
Status: Deferred for Super-MCP, but implemented in parent app's local model proxy.
Parent app implementation (2026-01-14):
localModelProxyServer.tsgenerates per-session token viacrypto.randomBytes()- Requires
X-Proxy-Authheader on all requests - Token passed to CLI via
ANTHROPIC_CUSTOM_HEADERSenv var
Super-MCP status:
- Host validation + localhost binding provide baseline protection
- Bearer auth for
/mcpendpoint still deferred (lower priority now that proxy is secured)
Super-MCP currently has no automated test suite. Security changes were verified via:
- TypeScript compilation (
npm run build) - Triple-review process with multiple LLM reviewers
- Manual testing where applicable
Future work should add tests for:
- ReDoS pattern rejection
- Log redaction edge cases
- OAuth state validation
- Host header validation
- MCP Security Best Practices
- CVE-2025-66414, CVE-2025-66416 (MCP DNS rebinding)
- CVE-2025-49596 (MCP Inspector RCE)