Works with the AI Agents you already use

    MCP Security & Sandbox Auditor

    by ishaan phaye

    1

    Battle-tested 8-domain security & concurrency audit skill for MCP servers, AI agent tool harnesses, and container sandboxes.

    Free

    Security scanned
    MCP Security & Sandbox Auditor

    MCP Security & Sandbox Auditor

    Example session with this skill installed

    Run a complete security and sandbox audit of our local Model Context Protocol (MCP) server (mcp-server/index.ts, runtime/sandbox.py, and Dockerfile). Inspect the tool execution boundaries, network egress, path sanitization, and container hardening against zero-trust standards.

    • Read your context and instructions
    • Compiled the mcp security

    I have completed a systematic security and isolation audit of your MCP server implementation and sandbox runtime across all 8 security domains.

    MCP Security & Sandbox Audit Report

    Release Gate Verdict: NO-GO
    Finding Breakdown: 2 Critical (P0) · 2 High (P1) · 1 Medium (P2) · 0 Low (P3)


    Invariant Scorecard

    DomainTarget File(s)StatusVerdict
    1. Path Traversal & Encodingsmcp-server/tools/fs.ts❌ FAILPrefix collision allows /workspace-evil access
    2. Sandbox & Kernel Hardeningruntime/sandbox.py, Dockerfile❌ FAILread_only rootfs and seccomp profile omitted
    3. Fail-Closed Executionruntime/sandbox.py❌ FAILSilent fail-open to host subprocess.run()
    4. Cgroups & Resource Limitsruntime/sandbox.py⚠️ PARTIALMemory cap active; swap and pids_limit missing
    5. SSRF & Egress Controlsmcp-server/tools/http.ts❌ FAILIPv4-mapped IPv6 & 3xx redirects bypass filter
    6. IPC Bridge Securityruntime/bridge.py✅ PASSStrictly bound to 127.0.0.1; CORS disabled
    7. Concurrency & Lockingruntime/pool.py✅ PASSNon-blocking spawns outside checkout mutex
    8. Context Window Safetymcp-server/utils/truncate.ts⚠️ PARTIALTruncation cuts multi-byte UTF-8 codepoints

    Prioritized Findings & Remediation Diffs

    1. [P0] Silent Fail-Open to Host Subprocess (CRIT-01)
    • Location: runtime/sandbox.py:42
    • Root Cause: Container launch failure falls back to host execution inside an unhandled except block.
    • Impact: Any Docker daemon timeout or error silently runs arbitrary LLM bash commands directly on the host machine.
    • Minimal Fix:
    --- a/runtime/sandbox.py
    +++ b/runtime/sandbox.py
    @@ -42,3 +42,3 @@
         except Exception as exc:
    -        return subprocess.run(cmd, shell=True, capture_output=True)
    +        raise RuntimeError(f"Sandbox execution failed closed: {exc}") from exc
    
    • Verification Test: Assert RuntimeError is raised when Docker daemon is stopped: pytest tests/test_security.py::test_fail_closed_on_daemon_error.

    2. [P0] Omitted Seccomp & Writable Root Filesystem (CRIT-02)
    • Location: runtime/sandbox.py:68
    • Root Cause: client.containers.run() is invoked without read_only=True or security_opt=["no-new-privileges:true"].
    • Impact: Malicious code executing in the container can modify system binaries or attempt privilege escalation.
    • Minimal Fix:
    --- a/runtime/sandbox.py
    +++ b/runtime/sandbox.py
    @@ -68,2 +68,5 @@
             image="sandbox-worker:latest",
    +        read_only=True,
    +        tmpfs={"/tmp": "rw,noexec,nosuid,size=16m"},
    +        security_opt=["no-new-privileges:true", f"seccomp={seccomp_profile_json}"],
    

    3. [P1] Boundary Escape via Prefix Collision (HIGH-01)
    • Location: mcp-server/tools/fs.ts:24
    • Root Cause: Path validation uses bare string prefix target.startsWith(workspaceDir).
    • Impact: Access to /workspace-private or /workspace_secrets is allowed because /workspace is a prefix.
    • Minimal Fix:
    --- a/mcp-server/tools/fs.ts
    +++ b/mcp-server/tools/fs.ts
    @@ -24,2 +24,3 @@
    -  if (!resolved.startsWith(workspaceRoot)) {
    +  const boundary = workspaceRoot.endsWith("/") ? workspaceRoot : `${workspaceRoot}/`;
    +  if (resolved !== workspaceRoot && !resolved.startsWith(boundary)) {
         throw new Error("Path traversal outside workspace");
    

    4. [P1] SSRF Bypass via IPv4-Mapped IPv6 & Redirects (HIGH-02)
    • Location: mcp-server/tools/http.ts:38
    • Root Cause: fetch() follows 3xx redirects automatically and does not normalize ::ffff:127.0.0.1 or [::ffff:7f00:1].
    • Impact: Allows attacker to pivot through the tool harness to hit AWS/GCP instance metadata (169.254.169.254) or localhost microservices.
    • Minimal Fix: Set redirect: "manual", loop through max 3 hops re-validating the Location header, and unpack ::ffff: IP representations prior to subnet checking.

    Uninspected Files Checklist

    • docker/seccomp-profile.json (Verify dangerous syscalls like ptrace, unshare, and bpf are blocked)
    • mcp-server/package.json (Verify @modelcontextprotocol/sdk version is patched against known CVEs)

    Recommended Next Steps

    1. Apply the 4 minimal diffs above.
    2. Run pytest tests/test_security.py and npm test to verify regression prevention.
    3. Re-run mcp-security-auditor to verify clean GO verdict before opening the server to untrusted tools.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Audits Model Context Protocol (MCP) servers, tool-calling agent harnesses, and micro-container sandboxes for real-world isolation bypasses, security vulnerabilities, and concurrency bottlenecks—going beyond README claims and mocked unit tests.

    What it checks (8-Domain Rubric):

    1. Path Traversal & Encodings: Multi-pass URI decoding, null bytes, Unicode NFKC normalization, Windows drive/UNC paths, and symlink/prefix-collision escapes.

    2. Container & Kernel Hardening: Verifies read_only rootfs, noexec /tmp tmpfs, cap_drop=["ALL"], no-new-privileges, non-root UID/GID, and wired custom Seccomp-BPF profiles.

    3. Fail-Closed Execution & Watchdogs: Catches silent fail-open fallbacks to host subprocesses and GNU timeout exit-code collisions (124 vs 137 OOM kills).

    4. Cgroups & Resource Ceilings: Swap-thrashing immunity (memswap_limit == mem_limit), PIDs limits for fork-bomb containment, and CPU quotas.

    5. SSRF & Egress Controls: Blocks RFC-1918, loopback, cloud metadata (169.254.169.254), CGNAT (100.64.0.0/10), IPv4-mapped IPv6 (::ffff:127.0.0.1), 3xx redirects, and DNS rebinding.

    6. IPC & Localhost Bridge Security: Strict 127.0.0.1 binding, wildcard CORS exposure, and ephemeral workspace cleanup on teardown.

    7. Concurrency & Pool Locking: Detects blocking container/process spawns held inside asyncio.Lock or mutexes that cause checkout starvation.

    8. Context-Window & UTF-8 Safety: Hard output truncation with UTF-8 continuation-byte scanning to prevent \uFFFD corruption.

    Output: Produces a prioritized GO / CONDITIONAL GO / NO-GO scorecard (P0–P3) with exact file paths, exploit scenarios, minimal remediation diffs, and verification tests.

    Requires access to implementation code and configuration files. Does not perform active network fuzzing or live exploit attempts.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 12 days ago

    • Free with an Agensi account

    Nothing to install. It runs in your AI agent.

    Optional
    Docker

    Runs purely as an in-session architectural and code auditor. No API keys, database credentials, or external accounts required.

    Permissions

    Read Files

    File Scopes

    **/*.ts
    **/*.py
    **/Dockerfile*
    **/*seccomp*.json

    Read access is used exclusively for offline inspection of MCP tool definitions, IPC bridges, container launch arguments, and Dockerfiles. The audit operates completely within your local agent session with zero telemetry, zero data egress, and no modification of your codebase without explicit request.

    Listed12 days ago

    What's inside

    Frequently Asked Questions

    Standard linters check for generic syntax flaws and known CVEs. This auditor specifically evaluates agent toolchains and container boundaries, catching cross-layer vulnerabilities like unwired seccomp profiles, silent fallbacks to host execution, timeout exit-code collisions, async lock starvation, and UTF-8 truncation bugs.

    It runs in any SKILL.md-compatible agent, including Claude Code, Cursor, Antigravity, Codex CLI, Windsurf, Cline, and OpenCode. It audits MCP servers and sandboxes written in TypeScript, Python, Go, Dockerfiles, and Linux cgroup configurations.

    You receive the complete SKILL.md audit workflow, the full 8-domain inspection checklist with exact root-cause breakdowns and minimal remediation diffs, and reproducible unit test templates to verify every fix.

    No. It is an offline, white-box architectural code auditor. It inspects your source code, configuration files, and container startup arguments inside your local agent workspace without sending network exploit traffic.

    Yes. It verifies that your container runtime actively sets a strict pids_limit so runaway process spawning hits EAGAIN, while confirming CPU quotas, dropped Linux capabilities, and watchdog timeouts are wired to kill runaway processes.

    No. The auditor operates strictly in read-only analysis mode, providing exact line numbers, explanations, and diff blocks. It never edits your files unless you explicitly instruct your agent to apply the fixes.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Free