Agent Pocket

Human-in-the-loop approval bridge for AI coding agents with dashboard notifications.

ai-ml
0Tools
20Findings
0Stars
Mar 19, 2026Last Scanned
8 critical · 9 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
100%2 rules
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
0Initial Access
0Defense Evasion
0Execution
0Persistence

Findings20

8critical
9high
2medium
1low

Critical8

criticalC1Command InjectionMCP03-command-injectionAML.T0054
Pattern "`[^`]+`" matched in source_code: "`http://localhost:${process.env.PORT || DEFAULT_SERVER_PORT}`" (at position 837)
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.
criticalC2Path TraversalMCP05-privilege-escalation
Pattern "\.\./\.\." matched in source_code: "../.." (at position 735)
Use path.resolve() to canonicalize paths, then verify the result starts with the intended base directory. Reject any input containing '..', null bytes, or encoded variants. Never concatenate user input into file paths.
criticalJ1Cross-Agent Configuration PoisoningMCP05-privilege-escalationAML.T0054
Pattern "(\.claude[/\\]|claude[/\\]settings|claude.*config)" matched in source_code: ".claude/" (at position 2699)
MCP servers MUST NOT write to AI agent configuration directories. If configuration management is the server's purpose, require explicit user confirmation before any write and restrict paths to the server's own config namespace. CVE-2025-53773 demonstrated this enables full RCE across agent boundaries.
criticalK14Agent Credential Propagation via Shared StateMCP05-privilege-escalationAML.T0054
Pattern "(process\.env|os\.environ|setenv|putenv).*(?:token|credential|api[_\s-]?key|secret|password)" matched in source_code: "process.env.APPROVAL_API_KEY" (at position 916)
Never write credentials to shared agent state. Use credential vaults (HashiCorp Vault, AWS Secrets Manager) with per-agent scoped access. Implement OAuth token exchange (RFC 8693) for cross-agent authorization. Redact credentials from all agent outputs before writing to shared memory. Required by OWASP ASI03/ASI07 and MAESTRO L7.
criticalK8Cross-Boundary Credential SharingMCP05-privilege-escalationAML.T0054
Pattern "(return|respond|output|result).*(?:token|credential|api[_\s-]?key|secret|password|bearer)" matched in source_code: "return { content: [{ type: "text", text: "Error: APPROVAL_API_KEY" (at position 17609)
Never forward, share, or embed credentials across trust boundaries. Use OAuth token exchange (RFC 8693) to create scoped, delegated tokens instead of passing original credentials. Never include credentials in tool responses. Required by ISO 27001 A.5.17 and OWASP ASI03.
criticalQ13MCP Bridge Package Supply Chain AttackMCP10-supply-chainAML.T0054
Pattern "["']@modelcontextprotocol/sdk["']\s*:\s*["'](?:\^|~|\*|latest)" matched in source_code: ""@modelcontextprotocol/sdk": "^" (at position 23384)
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.
criticalQ4IDE MCP Configuration InjectionMCP10-supply-chainAML.T0054
Pattern "(?:\.CURSOR|\.Cursor)[/\\]" matched in source_code: ".cursor/" (at position 2533)
MCP servers must NOT write to IDE configuration files (.cursor/mcp.json, .vscode/settings.json, .claude/settings.local.json) without explicit, interactive user confirmation that cannot be bypassed by repository-controlled settings. CVE-2025-54135/54136 (Cursor), CVE-2025-59536 (Claude Code) demonstrated that auto-start and silent config mutation enable RCE. Implement case-normalized path validation (CVE-2025-59944). Never use enableAllProjectMcpServers in shared repositories.
criticalQ6Agent Identity Impersonation via MCPMCP05-privilege-escalationAML.T0054
Pattern "(?:agent[_\s-]?id|agent[_\s-]?name|agent[_\s-]?role|caller[_\s-]?agent|source[_\s-]?agent).*(?:param|arg|input|string)" matched in source_code: "agentId?: string; ideType?: string" (at position 18600)
MCP tools in multi-agent systems must verify agent identity cryptographically — never accept agent_id/agent_role as plain string parameters. Use cryptographic attestation (signed tokens, mTLS certificates, or capability tokens) for inter-agent communication. Implement the principle of least privilege: each agent should only be able to claim its own identity. Reference: OWASP ASI03, arXiv 2602.19555.

High9

highK11Missing Server Integrity VerificationMCP10-supply-chainAML.T0054
Pattern "(?:download|fetch|pull).*(?:server|plugin|tool)(?!.*(?:sha256|sha512|checksum|digest|integrity|hash|verify))" matched in source_code: "fetch(`${SERVER" (at position 1520)
Implement cryptographic verification for MCP server connections: (1) Pin server TLS certificates or public keys, (2) Verify server tool definition checksums against a known-good manifest, (3) Use package manager integrity checks (npm integrity, pip --require-hashes). The MCP spec recommends but doesn't yet mandate server signing — implement it proactively. Required by ISO 27001 A.8.24 and CoSAI MCP-T6.
highK15Multi-Agent Collusion PreconditionsMCP05-privilege-escalationAML.T0054
Pattern "(agent[_\s-]?(?:id|name|identity|source))\s*[:=]\s*(?:req|request|params|input|args)(?!.*(?:verify|validate|authenticate|whitelist|allowlist))" matched in source_code: "agentId = args" (at position 18648)
Implement collusion-resistant multi-agent architecture: (1) Verify agent identity cryptographically before accepting commands, (2) Apply ACLs to shared write surfaces, (3) Rate-limit cross-agent invocations, (4) Audit all inter-agent communication with timestamps and agent IDs, (5) Baseline normal interaction patterns for anomaly detection. Required by MAESTRO L7 and CoSAI MCP-T9.
highK16Unbounded Recursion / Missing Depth LimitsMCP07-insecure-configAML.T0054
Pattern "while\s*\(\s*(?:true|1|!0)\s*\)\s*\{(?!.*(?:break|return|throw|limit|max|timeout))" matched in source_code: "while (true) {" (at position 1818)
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.
highD1Known CVEs in DependenciesMCP08-dependency-vuln
Dependency "@modelcontextprotocol/sdk@1.0.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.
highP9Missing Container Resource LimitsMCP07-insecure-configT1499.001
Pattern "(?:for|while)\s*[^}]*(?:fs\.writeFile|open\s*\([^)]*["']w|createWriteStream)(?!.*(?:limit|max|count|quota))" matched in source_code: "fore = existing.slice(0, idx).trimEnd(); const after = endIdx !== Infinity ? "\n\n" + existing.slice(endIdx).trimStart() : ""; fs.writeFile" (at position 14884)
Always set resource limits for MCP server containers: memory (--memory), CPU (--cpus), PIDs (--pids-limit), file descriptors (--ulimit nofile), and open files. In Kubernetes, set both requests and limits in the container spec. Use LimitRange and ResourceQuota at the namespace level as a safety net. Set pids.max in cgroups to prevent fork bombs. A missing PID limit allows a single tool invocation to fork-bomb the host (CVE-2025-26449 class).
highQ15A2A/MCP Protocol Boundary ConfusionMCP06-excessive-permissionsAML.T0054
Pattern "(?:discover|register|advertise).*(?:agent|skill|capability)(?!.*(?:verify|auth|sign|trust))" matched in source_code: "register_as_agent" (at position 6399)
Servers bridging A2A and MCP protocols must: (1) sanitize all A2A task metadata before passing to MCP tool inputs, (2) apply MCP content policies to A2A TextPart/FilePart/DataPart content, (3) validate A2A push notifications before they re-enter MCP context, (4) require cryptographic verification for agent discovery and registration (prevent fake agent advertisement — arXiv 2602.19555), (5) maintain separate permission models for A2A and MCP operations — trust in one protocol must not automatically grant trust in the other.
highQ14Concurrent MCP Server Race ConditionMCP07-insecure-configT1068
Pattern "(?:read|write|modify|delete).*(?:file|path|directory)(?!.*(?:lock|mutex|semaphore|flock|atomic))" matched in source_code: "readFileSync(filePath" (at position 14053)
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.
highO6Server Fingerprinting via Error ResponsesMCP04-data-exfiltrationAML.T0057
Pattern "catch\s*\([^)]*\)\s*\{[^}]*(?:res\.(?:send|json)|return).*(?:err(?:or)?\.(?:message|stack|code)|connection|host|port|database)" matched in source_code: "catch (err: any) { return { content: [{ type: "text", text: `Error: ${err.message" (at position 15809)
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.
highC3Server-Side Request Forgery (SSRF)MCP04-data-exfiltrationAML.T0057
Pattern "\bfetch\s*\([^)]*\$\{[^}]*(?:url|uri|host|target|endpoint|param|input|args)[^}]*\}" matched in source_code: "fetch(`${SERVER_URL}" (at position 1520)
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.

Medium2

mediumK17Missing Timeout or Circuit BreakerMCP07-insecure-configAML.T0054
Pattern "(?:fetch|axios|got|request|urllib|httpx|http\.get|http\.post)\s*\((?!.*(?:timeout|signal|AbortSignal|deadline|cancel))" matched in source_code: "fetch(" (at position 1520)
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.
mediumC6Error LeakageMCP09-logging-monitoring
Pattern "catch\s*\([^)]*\)\s*\{[^}]*(?:throw|return).*(?:err|error)\.(?:message|stack)" matched in source_code: "catch (err: any) { return { content: [{ type: "text", text: `Error: ${err.message" (at position 15809)
Return generic error messages to clients. Log detailed errors server-side. Never expose stack traces, file paths, or internal error details in responses.

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.