Originally published on opena2a.org
#security-research#ai-agents#mcp#hackmyagent#openclaw

The State of AI Agent Security: 97,000 Hosts, 1,190 Exposed Configs, and What We Did About It

OpenA2A Team||12 min read

TL;DR: We scanned 97,013 internet-facing hosts for AI agent vulnerabilities. 14.4% had confirmed security issues. 1,190 had their system instructions (CLAUDE.md) publicly readable. 645 had MCP tool definitions exposed. 32 were leaking API keys in HTTP responses. These are not theoretical risks -- they are production systems, reachable right now.

97,013
Hosts Discovered
11,100
Hosts Scanned
1,594
Confirmed Vulnerable
14.4%
Vulnerability Rate

How We Collected This Data

We used 207 Shodan queries across 10 categories -- Python frameworks, Node.js servers, WebSocket endpoints, API patterns, AI/ML infrastructure, and more -- to identify internet-facing hosts that might be running AI agent infrastructure.

Each candidate IP was then scanned using HackMyAgent's external scanner, which performs 12 active security checks: probing for MCP SSE endpoints, MCP tool listings, exposed configuration files, CLAUDE.md system instructions, API keys in HTTP responses, gateway endpoints, debug mode, and more.

Every number in this report comes from our scanner. If we couldn't confirm a vulnerability, we didn't count it.

What We Found

Across 11,100 scanned hosts, we confirmed 8,449 individual security findings.

FindingCountSeverity
Outdated API Endpoints5,042Medium
CLAUDE.md Exposed1,190High
Outdated Versions829Medium
MCP Tools Exposed645Critical
Gateway Exposed289Critical
Debug Mode Enabled272Medium
Unauthenticated MCP58Critical
Config Files Exposed54Critical
API Keys in Responses32Critical
WebSocket Control Exposed22Critical
MCP SSE Exposed14Critical

1,190 Agent Configurations on the Open Internet

CLAUDE.md files contain system instructions for AI agents -- behavioral rules, tool access policies, persona definitions, and sometimes credentials. They are the equivalent of an application's source code and configuration combined into one file.

We found 1,190 of them accessible via HTTP GET requests on the public internet.

What an attacker learns from a CLAUDE.md file:

  • What tools the agent has access to -- file system operations, database queries, API calls, code execution capabilities
  • How the agent makes decisions -- authorization logic, escalation rules, content filters, guardrails (and how to bypass them)
  • Internal infrastructure details -- database names, API endpoints, service dependencies, deployment architecture
  • Credentials and API keys -- some CLAUDE.md files contain hardcoded secrets (we found 32 hosts leaking API keys in HTTP responses)
Exposing a CLAUDE.md file is equivalent to publishing your application's security policy alongside its source code. An attacker doesn't need to probe for vulnerabilities -- the instructions tell them exactly where to look.

645 MCP Tool Definitions Exposed

The Model Context Protocol (MCP) is how AI agents connect to external tools. MCP servers expose a /tools endpoint that lists every available tool with its parameters and descriptions.

645 hosts had their MCP tool listings publicly accessible. 58 of those had no authentication at all -- meaning anyone on the internet could invoke the tools directly.

14 hosts exposed MCP SSE (Server-Sent Events) endpoints, which allow real-time bidirectional communication with the agent.

# What an attacker sees on an exposed MCP endpoint
$ curl https://target:8000/tools
{
  "tools": [
    { "name": "execute_sql", "description": "Run SQL queries..." },
    { "name": "read_file", "description": "Read any file..." },
    { "name": "run_command", "description": "Execute shell..." }
  ]
}

289 Agent Gateways Reachable from the Internet

AI agent frameworks like OpenClaw use gateway servers (typically on port 18789) to manage agent sessions, tool execution, and channel integrations. We found 289 gateway instances reachable from the public internet. 22 of those also had their WebSocket control plane (port 18790) exposed.

When we analyzed OpenClaw's gateway code, we found that the config.get API method returns the entire configuration object -- including Discord bot tokens, Slack OAuth tokens, Telegram bot tokens, and LLM provider API keys.

What We're Doing About It

Reporting vulnerabilities without contributing fixes is incomplete work. We are doing both.

Contributing Upstream: OpenClaw Skill Code Safety Scanner

OpenClaw has 145,000+ GitHub stars and a known malicious skills problem. We submitted PR #9806 -- a skill/plugin code safety scanner that detects dangerous patterns before they execute.

  • dangerous-exec -- child_process.exec/spawn command injection
  • dynamic-code-execution -- eval() and new Function()
  • potential-exfiltration -- file read + outbound HTTP
  • env-harvesting -- process.env access + network send
  • obfuscated-code -- hex-encoded strings, large base64 payloads
  • crypto-mining -- stratum protocol indicators
  • suspicious-network -- WebSocket to non-standard ports

HackMyAgent: Scanning at Scale

The internet-wide scan data in this report was collected using HackMyAgent, our open-source security scanner for AI agents.

Secure Mode

Static analysis of agent codebases. 100+ checks across credentials, network config, MCP servers, plugins, and more.

npx hackmyagent secure ./my-agent

Attack Mode

55 adversarial payloads across prompt injection, jailbreaking, data exfiltration, capability abuse, and context manipulation.

npx hackmyagent attack http://agent/v1

Recommendations

If you are running AI agents in production:

1

Audit your network exposure

Run hackmyagent scan your-domain.com to check what's reachable from the internet.

2

Protect CLAUDE.md and config files

Configure your web server to deny access to /.claude/, /CLAUDE.md, /mcp.json, /.env, and other configuration paths.

3

Authenticate MCP endpoints

Every MCP server should require authentication. An exposed /tools endpoint is an invitation to enumerate and invoke your agent's capabilities.

4

Scan plugins before installing

Use static analysis to detect dangerous patterns in plugin code before execution.

5

Don't use dangerous config flags in production

Flags like dangerouslyDisableDeviceAuth exist for local development. They should never be enabled on internet-facing deployments.

6

Rotate exposed credentials immediately

If your CLAUDE.md or config files were publicly accessible, assume any credentials in them are compromised.

Check your infrastructure

# Scan your agent codebase
npx hackmyagent secure ./my-agent-project
# Test your agent with adversarial payloads
npx hackmyagent attack http://localhost:3000/v1/chat/completions

Disclosure: This research was conducted using publicly accessible services only. No authentication was bypassed, no private data was accessed, and no vulnerabilities were exploited. IP addresses are anonymized in public reporting.

About OpenA2A: OpenA2A builds open-source security tools for AI agents. Our projects include HackMyAgent (security scanner), AIM (agent identity management), and the OpenA2A Registry (agent trust and verification).