<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Faizan Khan</title>
    <description>The latest articles on DEV Community by Faizan Khan (@tana_shahh).</description>
    <link>https://dev.to/tana_shahh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3950786%2Fbbb7a906-0b39-4dc5-9352-19f49b46d016.jpg</url>
      <title>DEV Community: Faizan Khan</title>
      <link>https://dev.to/tana_shahh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tana_shahh"/>
    <language>en</language>
    <item>
      <title>I Scanned 35 MCP Servers for Security Vulnerabilities. 62% Had Issues.</title>
      <dc:creator>Faizan Khan</dc:creator>
      <pubDate>Mon, 25 May 2026 13:39:28 +0000</pubDate>
      <link>https://dev.to/tana_shahh/i-scanned-35-mcp-servers-for-security-vulnerabilities-62-had-issues-10m8</link>
      <guid>https://dev.to/tana_shahh/i-scanned-35-mcp-servers-for-security-vulnerabilities-62-had-issues-10m8</guid>
      <description>&lt;p&gt;MCP (Model Context Protocol) is becoming the standard way AI agents connect to external tools. Claude, ChatGPT, Cursor, VS Code Copilot, and Gemini all support it. There are over 10,000 MCP servers in the ecosystem. But nobody was systematically checking if they're secure.&lt;/p&gt;

&lt;p&gt;So I built a scanner and tested 35 real servers and client configurations from public GitHub repositories. The results weren't great.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Numbers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Total scanned&lt;/td&gt;
&lt;td&gt;35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;With findings&lt;/td&gt;
&lt;td&gt;62%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Critical&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;299&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;181&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total findings&lt;/td&gt;
&lt;td&gt;486&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Finding #1: Path Traversal is Everywhere
&lt;/h2&gt;

&lt;p&gt;The single most common vulnerability, appearing 262 times. MCP servers that handle file operations routinely accept user-controlled path parameters without validation. An agent (or attacker manipulating the agent) can request &lt;code&gt;../../../../etc/passwd&lt;/code&gt; and the server reads it.&lt;/p&gt;

&lt;p&gt;This is worse than typical web apps because the "user" isn't a human making deliberate requests. It's an AI agent that can be manipulated through prompt injection in any data it processes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding #2: Your Cursor Config Might Be a Backdoor
&lt;/h2&gt;

&lt;p&gt;6 of the configs I scanned had critical severity findings. Shell metacharacters in server arguments that could achieve RCE when the IDE loads the config.&lt;/p&gt;

&lt;p&gt;This is the same vulnerability class behind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CVE-2025-6514 (437K npm downloads, CVSS 9.6)&lt;/li&gt;
&lt;li&gt;CVE-2026-30615 (Windsurf RCE)&lt;/li&gt;
&lt;li&gt;CVE-2025-54136 (Cursor)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One config I found used &lt;code&gt;bash -c&lt;/code&gt; with a chained command string as the server entry. That's a live RCE vector in a public repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding #3: API Keys Committed in the Open
&lt;/h2&gt;

&lt;p&gt;5 of the 15 client configs passed sensitive credentials as environment variables. Real OpenAI keys, AWS secrets, and Amadeus API keys in public repos.&lt;/p&gt;

&lt;p&gt;MCP configs are especially dangerous because they often contain keys for multiple services at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding #4: Unpinned Packages
&lt;/h2&gt;

&lt;p&gt;Nearly every config uses &lt;code&gt;npx -y&lt;/code&gt; without version pinning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"server"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@some-package/mcp-server"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No version pin means a supply chain attack propagates to everyone automatically. The &lt;code&gt;-y&lt;/code&gt; flag suppresses confirmation prompts.&lt;/p&gt;

&lt;p&gt;Safe version: &lt;code&gt;"@some-package/mcp-server@0.6.2"&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding #5: Shell Execution Without Sanitization
&lt;/h2&gt;

&lt;p&gt;5 servers contained &lt;code&gt;exec.Command("bash", "-c", ...)&lt;/code&gt; or &lt;code&gt;subprocess.run(shell=True)&lt;/code&gt; with user-controllable parameters. If an attacker can influence the tool input through prompt injection, they get arbitrary command execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Threat Model is Different
&lt;/h2&gt;

&lt;p&gt;In MCP, you're not securing against a human attacker directly. You're securing against an AI agent that might be manipulated by an attacker through any data it processes. Every tool input should be treated as potentially adversarial.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check Your Own Setup
&lt;/h2&gt;

&lt;p&gt;I built &lt;a href="https://github.com/fayzkk889/MCPSense" rel="noopener noreferrer"&gt;MCPSense&lt;/a&gt; to catch all of this. Open source, MIT licensed, single binary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install&lt;/span&gt;
curl &lt;span class="nt"&gt;-sSL&lt;/span&gt; https://raw.githubusercontent.com/fayzkk889/MCPSense/main/install.sh | sh

&lt;span class="c"&gt;# Scan your config&lt;/span&gt;
mcpsense scan ~/.cursor/mcp.json

&lt;span class="c"&gt;# Scan a server&lt;/span&gt;
mcpsense scan ./my-mcp-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;27 checks covering tool poisoning (ASCII smuggling, annotation lying, cross-tool manipulation), config injection, prompt injection, SSRF, path traversal, and spec compliance.&lt;/p&gt;

&lt;p&gt;SARIF output for GitHub Code Scanning. GitHub Action for CI/CD. Four scan modes.&lt;/p&gt;

&lt;p&gt;Full writeup with terminal output examples: &lt;a href="https://mcpsense.site/blog/" rel="noopener noreferrer"&gt;mcpsense.site/blog&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this was useful, &lt;a href="https://github.com/fayzkk889/MCPSense" rel="noopener noreferrer"&gt;star the repo&lt;/a&gt; so others can find it.&lt;/em&gt;&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>mcp</category>
      <category>go</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
