io.github.lapfelix/xcodemcp

Control Xcode directly via JXA for build, test, debug operations with XCLogParser integration

lapfelixapi-integrationTypeScript
0Tools
20Findings
Mar 24, 2026Last Scanned
6 critical · 11 high · 2 medium · 1 low findings detected

Security Category Deep Dive

Prompt Injection
Prompt & context manipulation attacks
69
Maturity
14
Rules
5
Sub-Categories
1
Gaps
64%
Implemented
56
Tests
1
Stories
PI-DIRDirect Input Injection
100%3 rules
Injection via tool descriptions and parameter fields
GAP-001Prompt Injection Coverage GapMissing detection coverage for emerging prompt injection attack variants not addressed by current rules
PI-INDIndirect / Gateway Injection
100%4 rules
Hidden instructions via external content and tool responses
PI-CTXContext Manipulation
100%2 rules
Context window saturation and prior-approval exploitation
PI-ENCEncoding & Obfuscation
100%3 rules
Payload hiding via invisible chars, base64, schema fields
PI-TPLTemplate & Output Poisoning
50%2 rules1 found
Injection via prompt templates and runtime tool output
Framework Coverage
OWASP MCP Top 1014/14
MITRE ATLAS14/14
CoSAI MCP2/14
OWASP Agentic Top 1012/14
Kill Chain Phases
1Initial Access
1Defense Evasion
1Execution
1Persistence

Findings20

6critical
11high
2medium
1low

Critical6

criticalJ5Tool Output Poisoning PatternsMCP01-prompt-injectionAML.T0054
[AST — J5] LLM manipulation pattern in return statement at L689: "to\s+fix\s+this" found in "`❌ XCLogParser not found\n\n💡 To fix this:\n• Install XCLogParser: brew install". Tool responses containing directives cause the AI to follow them as instructions.
Never include user input or LLM manipulation directives in error messages or tool responses. Use structured error codes.
criticalJ5Tool Output Poisoning PatternsMCP01-prompt-injectionAML.T0054
[AST — J5] LLM manipulation pattern in return statement at L697: "to\s+fix\s+this" found in "`❌ Xcode application not found\n\n💡 To fix this:\n• Install Xcode from the Mac ". Tool responses containing directives cause the AI to follow them as instructions.
Never include user input or LLM manipulation directives in error messages or tool responses. Use structured error codes.
criticalC1Command InjectionMCP03-command-injectionAML.T0054
Pattern "`[^`]+`" matched in source_code: "`http://localhost:${port}`" (at position 2894)
Replace exec()/execSync() with execFile() and pass arguments as an array, never as a string. Validate all inputs against an allowlist before use in any shell context. For subprocess.run, always pass a list and shell=False.
criticalN11Protocol Version Downgrade AttackMCP07-insecure-configAML.T0054
Pattern "(?:protocolVersion|protocol_version)\s*[:=]\s*['"](?:2024-11-05|1\.0|0\.)['"]" matched in source_code: "protocolVersion: '2024-11-05'" (at position 5483)
Enforce a minimum protocol version during the initialize handshake. The 2024-11-05 spec lacks tool annotations, elicitation, and transport session security — downgrading to it strips safety features added in 2025-03-26 and 2025-06-18. Reject connections requesting protocol versions below your minimum supported version. Never echo back the client-requested version without validation.
criticalQ13MCP Bridge Package Supply Chain AttackMCP10-supply-chainAML.T0054
Pattern "["']@modelcontextprotocol/sdk["']\s*:\s*["'](?:\^|~|\*|latest)" matched in source_code: ""@modelcontextprotocol/sdk": "^" (at position 78985)
MCP bridge packages (mcp-remote, mcp-proxy, @modelcontextprotocol/sdk, fastmcp) are high-value supply chain targets — CVE-2025-6514 (CVSS 9.6) in mcp-remote affected 437,000+ installs. Always pin exact versions (no ^ or ~ ranges). Use lockfiles (package-lock.json, pnpm-lock.yaml, uv.lock). Never run `npx mcp-remote` without version pinning. Verify package integrity with `npm audit` or `pip-audit` before deployment. Reference: CVE-2025-6514, OWASP ASI04.
criticalQ9Agentic Workflow DAG ManipulationMCP05-privilege-escalationAML.T0058
Pattern "(?:next[_\s]?(?:step|node|agent)|route[_\s]?to|redirect[_\s]?to|skip[_\s]?(?:step|node|validation))" matched in source_code: "route to" (at position 3903)
MCP tools must NOT modify agentic workflow graphs, execution order, or routing during runtime. Workflow structure should be immutable once execution begins. If dynamic workflow modification is required, implement: (1) approval gates that require human confirmation before graph mutations, (2) integrity checks that validate the workflow graph against a known-good baseline after each step, (3) audit logging of all graph modifications with rollback capability. Reference: arXiv 2602.19555, Trend Micro subgraph impersonation attack (2026).

High11

highC3Server-Side Request Forgery (SSRF)MCP04-data-exfiltrationAML.T0057
Pattern "new\s+URL\s*\(\s*(?:req|request|input|param|params|args|url|uri|href|link|target|destination|endpoint|host|address|resource|src|source)" matched in source_code: "new URL(req" (at position 2877)
Validate ALL user-supplied URLs before making HTTP requests: 1. Parse the URL and check the hostname against an explicit allowlist of permitted domains. 2. Block requests to RFC 1918 private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. 3. Block loopback (127.0.0.0/8), link-local (169.254.0.0/16), and IPv6 equivalents. 4. Block file:// and other non-http(s) protocols explicitly. 5. Disable automatic redirect following, or re-validate each redirect destination. 6. In cloud environments: block requests to IMDS endpoints (169.254.169.254, metadata.google.internal) at both the application AND network layer. Example (Node.js): Use the `ssrf-req-filter` package or implement URL validation against an allowlist before calling fetch/axios/got.
highD1Known CVEs in DependenciesMCP08-dependency-vuln
Dependency "@modelcontextprotocol/sdk@0.6.0" has known CVEs:
Update dependencies to versions that patch known CVEs. Run 'npm audit fix' or 'pip-audit' to identify and resolve vulnerable dependencies.
highJ5Tool Output Poisoning PatternsMCP01-prompt-injectionAML.T0054
[AST — J5] Catch block at L1326 interpolates error variable "error" into response. If the error originates from attacker-controlled input (e.g., malformed data), the error message becomes an injection vector into the AI's context.
Never include user input or LLM manipulation directives in error messages or tool responses. Use structured error codes.
highJ5Tool Output Poisoning PatternsMCP01-prompt-injectionAML.T0054
[AST — J5] Catch block at L1424 interpolates error variable "error" into response. If the error originates from attacker-controlled input (e.g., malformed data), the error message becomes an injection vector into the AI's context.
Never include user input or LLM manipulation directives in error messages or tool responses. Use structured error codes.
highO6Server Fingerprinting via Error ResponsesMCP04-data-exfiltrationAML.T0057
Pattern "(?:diagnostics?|debug|system_?info|server_?info|health_?detailed|status_?detail)\s*[:=]\s*\{[^}]*(?:version|os|arch|platform|uptime|memory|cpu|disk|hostname|pid)" matched in source_code: "serverInfo: { name: 'xcode-mcp-server', version" (at position 5704)
Never expose process, OS, runtime, or database metadata in tool responses or error messages. Use generic error messages ("An error occurred") for production responses. Remove or disable debug/diagnostic endpoints. If health endpoints are needed, limit them to simple "ok"/"error" status without infrastructure details. Wrap all error handlers with a sanitization layer that strips system information.
highI15Transport Session SecurityMCP07-insecure-configAML.T0054
Pattern "(http://).*(/message/|/mcp/|/sse)" matched in source_code: "http://localhost:${port}/sse" (at position 7661)
Use HTTPS for all MCP Streamable HTTP endpoints. Generate cryptographically random session IDs (min 128 bits entropy). Do not accept session IDs from user input (CVE-2025-6515). Validate TLS certificates — do not disable certificate verification.
highK13Unsanitized Tool OutputMCP02-tool-poisoningAML.T0054
Pattern "(?:query|execute|select|find).*(?:return|respond|result|rows|data)(?!.*(?:sanitize|escape|encode|map|filter|select|pick))" matched in source_code: "find_xcresult" (at position 42026)
Sanitize all external data before including in tool responses. Implement output encoding that neutralizes prompt injection patterns. Truncate excessively long content. Validate structure before passing database results. Apply the principle: treat all external data as untrusted, even in tool outputs. Required by CoSAI MCP-T4.
highK16Unbounded Recursion / Missing Depth LimitsMCP07-insecure-configAML.T0054
Pattern "(invoke|call|execute)[_\s-]?(?:tool|agent|self)(?!.*(?:depth|level|limit|max[_\s-]?(?:depth|recursi|iter|call)|count))" matched in source_code: "CallTool" (at position 20510)
Add explicit depth/recursion limits to all recursive operations. Use iterative approaches where possible. Set maximum depth for directory walking (max_depth=10), tree traversal (max_level=20), and agent re-invocation (max_calls=5). Implement circuit breakers that halt after N iterations. Required by EU AI Act Art. 15 (robustness) and OWASP ASI08.
highN10Incomplete Handshake Denial of ServiceMCP07-insecure-configAML.T0054
Pattern "(?:createServer|listen)\s*\((?!.*(?:maxConnections|maxClients|connectionLimit|MAX_CONN))" matched in source_code: "createServer(" (at position 2810)
Enforce a handshake timeout (recommended: 30 seconds) — terminate connections that do not complete the initialize handshake within the deadline. Limit maximum concurrent pending connections. An attacker can exhaust server connection slots by initiating MCP connections without completing the handshake (Slowloris-style attack). Reference: MCP spec 2025-03-26 lifecycle — initialize MUST complete before functional requests.
highQ14Concurrent MCP Server Race ConditionMCP07-insecure-configT1068
Pattern "(?:read|write|modify|delete).*(?:file|path|directory)(?!.*(?:lock|mutex|semaphore|flock|atomic))" matched in source_code: "WriteStream(this.logFile" (at position 74032)
MCP servers sharing filesystem or database backends with other servers must implement proper concurrency controls. Use: (1) file locking (flock/lockfile) for filesystem operations, (2) database transactions for all read-modify-write sequences, (3) atomic file operations (O_EXCL, mkdtemp) instead of check-then-create, (4) lstat() to detect symlinks before following (CVE-2025-53109). Never assume exclusive access to shared resources — other MCP servers may be operating concurrently.
highJ5Tool Output Poisoning PatternsMCP01-prompt-injectionAML.T0054
[AST — J5] Catch block at L981 interpolates error variable "error" into response. If the error originates from attacker-controlled input (e.g., malformed data), the error message becomes an injection vector into the AI's context.
Never include user input or LLM manipulation directives in error messages or tool responses. Use structured error codes.

Medium2

mediumK20Insufficient Audit Context in LoggingMCP09-logging-monitoringAML.T0054
Pattern "logger\.(info|warn|error)\s*\(.*(?:tool|request|handle|invoke)(?!.*(?:requestId|correlationId|traceId|spanId|agent[_\s-]?id|user[_\s-]?id))" matched in source_code: "Logger.error('🚨 UNHANDLE" (at position 853)
Use structured logging that includes all five ISO 27001 A.8.15 fields: (1) WHO — agent/user identity, (2) WHAT — tool name and operation, (3) WHEN — ISO 8601 timestamp, (4) WHERE — server ID and correlation ID, (5) OUTCOME — success/failure and result summary. Replace console.log with structured loggers (pino, winston). Add correlation IDs for request tracing across multi-agent chains.
mediumK17Missing Timeout or Circuit BreakerMCP07-insecure-configAML.T0054
Pattern "(?:query|execute|find|select|aggregate)\s*\((?!.*(?:timeout|maxTimeMS|statement_timeout|deadline|cancel))" matched in source_code: "find(" (at position 9743)
Add timeouts to ALL external calls: HTTP requests (30s), database queries (10s), subprocess execution (60s), and MCP tool calls (30s). Implement circuit breakers that open after N consecutive failures (e.g., opossum, cockatiel). Use AbortSignal for cancellable operations. Required by EU AI Act Art. 15 and OWASP ASI08.

Low1

lowF4MCP Spec Non-ComplianceMCP07-insecure-config
Server fails MCP spec compliance checks: required:server_name; required:server_version; required:protocol_version; recommended:tool_descriptions; recommended:parameter_descriptions
Follow the MCP specification for server metadata. Include server name, version, and protocol version. Provide descriptions for all tools and parameters.