Skip to content

Scan Layers

munio scan uses 8 layers of analysis, each progressively deeper. Findings from all layers are aggregated into a single report.

Static analysis of MCP configuration files for supply chain risks. Runs via munio config-scan.

  • Unpinned npm packages, typosquatting, unscoped packages
  • Dangerous environment variables (LD_PRELOAD, NODE_OPTIONS, etc.)
  • Hardcoded credentials, shell metacharacters, HTTP URLs
  • Docker images without digest, file permission issues

10 checks (SC_001 through SC_010) plus 3 Safety Control Tampering (SCT) checks:

CheckIDDescription
Permissive approvalsSC_011MCP server config disables safety controls by default (env vars or args)
WebSocket without originSC_012WebSocket server has no origin validation — vulnerable to cross-site hijacking
Host-mode executionSC_013MCP server tools run on host without sandbox isolation

See Config Scan Guide for details.

Confidence: 0.7-0.95

Validates the JSON Schema of tool input parameters.

  • Missing description on tool or parameters
  • Missing type annotations
  • Overly permissive schemas (no constraints on strings, numbers)
  • Empty or trivial enum values

Confidence: 0.5-0.7 (structural issues, not necessarily malicious)

Pattern-based detection of known attack signatures.

  • Keyword matching for dangerous patterns (e.g., ignore previous, system prompt)
  • URL/IP detection in descriptions (potential SSRF/exfiltration)
  • Path patterns (../, /etc/, ~/.ssh/)
  • Code execution indicators (eval, exec, subprocess)
  • Pinning detection: hardcoded values that override user intent

Confidence: 0.6-0.85

Fine-tuned E5-small-v2 embedding model with logistic regression head.

  • Trained on 2100+ malicious and 6000+ benign tool descriptions
  • F1 = 0.995 on English prompt injection
  • 12ms median inference on CPU
  • Requires model download: munio scan download-models

Confidence: 0.8-0.99

sklearn char n-gram classifier for non-English attacks.

  • HashingVectorizer with char n-grams (2-5) + 20 structural features
  • Trained on 397K samples machine-translated to 188 languages
  • <0.3ms inference, <5MB model, no PyTorch dependency
  • Detects prompt injection in Chinese, Arabic, Russian, Korean, etc.

Confidence: 0.7-0.95

19 semantic checks analyzing parameter schemas in context:

CheckIDDescription
Path traversalL3_001Path/file params without traversal-rejecting pattern
SSRF/URL riskL3_002URL/URI params without format or restrictive pattern
SQL injectionL3_003Query/SQL params in DB-context tools
Command injectionL3_004Command/script/exec params without enum
Unbounded array DoSL3_005Array without maxItems
Boolean security bypassL3_006force/unsafe/skip_auth boolean params
Weak regex constraintL3_007Unanchored or overly broad pattern
Conflicting schema constraintsL3_008min>max, empty enum
Template injectionL3_009template/format_string/jinja params
Dangerous numeric paramL3_010limit/timeout/port without bounds
Schema poisoningL3_011Tool descriptions with LLM manipulation instructions
Credential exposureL3_012password/token/api_key params without writeOnly
Insecure defaultsL3_013Dangerous boolean defaults like recursive=true
Unconfirmed destructive opsL3_014delete/drop/purge without confirmation param
Cross-tenant IDL3_015user_id/tenant_id without UUID format validation
Mass assignmentL3_016additionalProperties allows arbitrary field injection
Raw infrastructure paramsL3_017K8s/Docker/Terraform strings without constraints
Privilege escalation paramsL3_018role/permission without enum
Unsafe deserializationL3_019yaml/pickle/protobuf string params

Uses word-segment matching (not substring) to minimize false positives. Context-aware: a path param on a filesystem tool is higher risk than on a browser tool.

Additionally, 1 safety control detection check:

CheckIDDescription
Safety tool detectionL3_020Tools whose name matches safety-related segments (approval, guardrail, security, sandbox, etc.) are flagged as capable of modifying safety controls. Confidence is boosted when parameters contain on/off enum values.

L3_020 produces findings with SAFETY_TAMPERING attack type and CWE-269.

Confidence: 0.75-0.95

Optional layer using Z3 SMT solver for mathematical proofs.

Terminal window
pip install "munio[z3]"

5 formal checks:

CheckIDWhat it proves
Path traversalL4_001Exists a string matching the schema that contains ../
SSRFL4_002Exists a URL matching the schema pointing to internal IPs
Command injectionL4_003Exists a string matching the schema containing shell metacharacters
Pattern contradictionL4_004Pattern + maxLength are contradictory (no valid input exists)
Unsafe enumL4_005Enum contains dangerous values (file://, ../, etc.)

Uses z3.InRe(Intersect()) for regex intersection proofs. Two-tier: Python concrete payloads first (fast), Z3 formal proof second (thorough).

Confidence: 0.95-1.0 (mathematical proof)

Cross-tool taint flow analysis using P/U/S (Provide/Use/Store) capability model.

  • Classifies each tool into capability categories (FILE_READ, HTTP_SEND, CODE_EXEC, SAFETY_CONFIG, etc.)
  • Builds a taint flow graph across all tools in the server
  • Detects toxic flows: data from sensitive source to exfiltration sink
  • 50-tool taxonomy, 17 capability categories, 16 toxic flow rules, 26 known dangerous combos
  • Generates SARIF codeFlows with full taint path

The SAFETY_CONFIG capability identifies tools that modify safety controls (e.g., exec.approvals.set, config.patch, security.set, guardrails.disable, sandbox.config). Three SCT-specific toxic flow rules detect safety tampering chains:

SourceSinkRiskDescription
FETCH_UNTRUSTEDSAFETY_CONFIGCRITICALUntrusted external data can disable safety controls before exploitation
SAFETY_CONFIGCODE_EXECCRITICALSafety controls can be weakened before code execution
CREDENTIAL_READSAFETY_CONFIGHIGHStolen credentials can be used to modify safety configurations

Flows involving SAFETY_CONFIG produce findings with SAFETY_TAMPERING attack type.

Example toxic flow:

read_file (FILE_READ) -> send_email (MSG_SEND)
Warning: Data from filesystem can be exfiltrated via email

Example SCT toxic flow:

fetch_url (FETCH_UNTRUSTED) -> exec.approvals.set (SAFETY_CONFIG)
CRITICAL: Untrusted external data can disable safety controls before exploitation

Confidence: 0.7-0.9

Optional layer using tree-sitter for AST-based taint tracking of MCP handler source code. Traces tool parameters through handler implementations to dangerous sinks.

Terminal window
pip install "munio[source]"
munio scan --server "npx @scope/server" --source ./server-src/

5 checks:

CheckIDCWEWhat it detects
Command injectionL7_001CWE-78Tool params flowing to exec, spawn, subprocess calls
SQL injectionL7_002CWE-89Tool params concatenated into SQL query strings
Path traversalL7_003CWE-22Tool params used in readFile, open without sanitization
SSRFL7_004CWE-918Tool params passed to fetch, request, urllib without URL validation
Code injectionL7_005CWE-94Tool params flowing to eval, Function(), exec() calls

Supports JavaScript/TypeScript and Python MCP server handlers. When scanning via --server "npx @scope/pkg", munio automatically downloads and extracts the npm package source (disable with --no-source).

Confidence: 0.85-0.95

Layers are independent — each produces its own findings. The orchestrator merges them by:

  1. Running all enabled layers in sequence
  2. Deduplicating findings with same tool + attack type
  3. Taking the highest confidence when duplicates exist
  4. Sorting by severity (CRITICAL -> HIGH -> MEDIUM -> LOW -> INFO)