# SECURITY REVIEW: claude-code-main
REAL THREATS
COMMAND INJECTION - CRITICAL
[27] Use of eval() in bash pipe command (line 99)
• Direct eval() usage in bash command processing
• Impact: Arbitrary code execution on host system with full user privileges
• Exploitability: HIGH - If user input reaches this path, instant RCE
• Severity: CRITICAL - This is how systems get owned
[93] Shell command execution via exec() (initReplBridge.ts:562)
• Executing shell commands through exec()
• Impact: Command injection if any unsanitized input reaches this
• Exploitability: Depends on input sanitization upstream (not visible in this scan)
• Severity: HIGH - Potential RCE vector
CREDENTIAL EXPOSURE - CRITICAL
[5] Hardcoded API key (upgrade.tsx:16)
• Generic API key embedded in source code
• Impact: Key compromise, unauthorized API access, potential account takeover
• Exploitability: IMMEDIATE - Anyone with repo access has the key
• Severity: CRITICAL - Credentials in source code = already compromised
[17] Hardcoded API key (datadog.ts:14)
• Datadog API key in source
• Impact: Unauthorized access to monitoring/logging, data exfiltration, log tampering
• Exploitability: IMMEDIATE
• Severity: CRITICAL - Analytics platforms often contain PII and business intelligence
[18] Hardcoded database credentials (datadog.ts:14)
• Default database credentials
• Impact: Direct database access, data breach, data manipulation
• Exploitability: IMMEDIATE if defaults unchanged
• Severity: CRITICAL - Database access = game over
[29] Hardcoded database credentials (diff.ts:31)
• More hardcoded DB credentials
• Impact: Same as above - full database compromise
• Exploitability: IMMEDIATE
• Severity: CRITICAL
INSECURE WEBSOCKET CONNECTIONS - CRITICAL
[1] Insecure WebSocket (replBridgeTransport.ts:189)
[2] Insecure WebSocket (workSecret.ts:77)
[20] Insecure WebSocket (voiceStreamSTT.ts:136)
[28] Insecure WebSocket (mcpServer.ts:64)
[31] Insecure WebSocket (ide.ts:795)• Using ws:// instead of wss://
• Impact: Man-in-the-middle attacks, credential interception, session hijacking
• Exploitability: HIGH on untrusted networks (coffee shops, airports, corporate)
• Severity: CRITICAL - These appear to be core bridge/REPL communications
• Special concern: workSecret.ts name suggests secrets transmitted over plaintext
ATTACK CHAINS
Chain 1: Credential Theft → Lateral Movement
1. Extract hardcoded API keys [5, 17] or DB credentials [18, 29]
2. Access monitoring systems to find additional credentials
3. Access database to extract user data, session tokens, more credentials
4. Pivot to other systems using discovered credentials
Chain 2: MITM → Code Execution
1. MITM insecure WebSocket connections [1, 2, 20, 28, 31]
2. Inject malicious payloads through intercepted bridge communication
3. If injected content reaches eval() [27] or exec() [93], achieve RCE
4. Compromise developer workstation or production system
Chain 3: Repository Access → Full Compromise
1. Attacker gains read access to repository (insider, compromised account, public repo)
2. Extract all hardcoded credentials [5, 17, 18, 29]
3. Use Datadog access to map infrastructure
4. Use DB credentials to extract all data
5. Use API keys to impersonate service
VERDICT
DEPLOY STATUS: DO NOT DEPLOY TO PRODUCTION
This codebase has
MULTIPLE CRITICAL SECURITY VULNERABILITIES that create immediate, exploitable attack vectors.
FIX IMMEDIATELY - BLOCKING ISSUES:
1. eval() usage [27] - Replace with safe parsing. This is a loaded gun.
2. All hardcoded credentials [5, 17, 18, 29] - Move to environment variables/secret management BEFORE any deployment. Rotate all exposed keys immediately. These are already compromised if the repo has ever been public or shared.
3. Insecure WebSockets [1, 2, 20, 28, 31] - Force TLS. Non-negotiable for anything beyond localhost development.
FIX URGENTLY:
4. exec() usage [93] - Audit all input paths, implement strict allowlisting, consider safer alternatives.
RISK ASSESSMENT:
• Current State: System is compromised if repo access was ever obtained by unauthorized parties
• Credential Rotation: Required immediately for all embedded secrets
• Production Readiness: NOT READY - Critical vulnerabilities present
• Data Breach Risk: HIGH - Direct database access possible
• RCE Risk: HIGH - Command injection vectors present
• Compliance: FAIL - Hardcoded credentials violate PCI, SOC2, GDPR requirements
HONEST TAKE:
The hardcoded credentials alone are a firing offense. If this repo was ever public, on someone's laptop that got stolen, in a backup, or accessed by a terminated employee -
you're already breached. The eval() is sloppy and dangerous. The insecure WebSockets show a lack of security awareness in the development process.
This needs a security audit beyond automated scanning. Fix these critical issues, then get a proper pentest.