Skip to content
Back to search

nuclei-templates-mcp

Nuclei templates that detect exposed and misconfigured MCP servers: unauthenticated access, exposed tools, CVE-2026-33252 cross-site requests, DNS rebinding. Detection only.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/garag0l--nuclei-templates-mcp/badge.svg)](/listings/garag0l--nuclei-templates-mcp)

HTML

<a href="/listings/garag0l--nuclei-templates-mcp"><img src="/api/listings/garag0l--nuclei-templates-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 74 lines
  1. # nuclei-templates-mcp
  2. **Nuclei templates that find exposed and misconfigured MCP servers: unauthenticated access, tools anyone can call, cross-site requests (CVE-2026-33252) and missing DNS-rebinding protection. Detection only.**
  3. [![CI](https://github.com/garag0l/nuclei-templates-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/garag0l/nuclei-templates-mcp/actions/workflows/ci.yml)
  4. [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
  5. ![Templates](https://img.shields.io/badge/templates-6-informational)
  6. ![nuclei-templates-mcp output](docs/demo.svg)
  7. ## Usage
  8. ```bash
  9. git clone https://github.com/garag0l/nuclei-templates-mcp
  10. nuclei -t nuclei-templates-mcp/http/mcp/ -u https://mcp.example.com
  11. nuclei -t nuclei-templates-mcp/http/mcp/ -l targets.txt -jsonl -o mcp-findings.jsonl
  12. ```
  13. Requires Nuclei v3.
  14. ### GitHub Action
  15. Scan a deployed MCP server from CI without installing nuclei yourself (Linux
  16. runners):
  17. ```yaml
  18. - uses: garag0l/nuclei-templates-mcp@v0.1.1
  19. with:
  20. target: https://mcp.example.com
  21. output: mcp-findings.jsonl
  22. ```
  23. Inputs: `target` (the MCP server URL), `validate` (`"true"` to only validate the
  24. templates), `output` (JSONL path), `nuclei-version` (pinned, checksum-verified
  25. install), `templates`, and `args`. Only scan servers you are authorized to test.
  26. ## Why this exists
  27. Trend Micro counted roughly 1,470 MCP servers exposed to the internet in 2026, many of them reachable without credentials. Several SDK advisories that year were about local servers that any web page could reach: missing DNS-rebinding protection, and cross-site `text/plain` requests that skip CORS preflight. Neither the public Nuclei templates nor the usual scanners had MCP-aware checks. These templates speak the protocol properly: a JSON-RPC `initialize` over Streamable HTTP, the legacy SSE transport, and RFC 9728 metadata.
  28. ## Templates
  29. | Template | Severity | What it detects | How |
  30. |---|---|---|---|
  31. | `mcp-unauthenticated-server` | medium | Server completes `initialize` without credentials; extracts server name + version | One `initialize` POST to `/mcp`, `/mcp/`, `/v1/mcp`, `/api/mcp`, `/` |
  32. | `mcp-tools-exposed` | high | Tool list readable without credentials; extracts tool names | `initialize` then `tools/list`. Works with stateful (session ID) and stateless servers. **Never calls a tool.** |
  33. | `mcp-cross-site-text-plain` | high | Accepts JSON-RPC as `text/plain` from a foreign `Origin`, so any web page can drive it ([CVE-2026-33252](https://github.com/advisories/GHSA-89xv-2j6f-qhc8) behavior) | One `initialize` with a CORS-safelisted content type |
  34. | `mcp-dns-rebinding-host-not-validated` | medium | Answers for an arbitrary `Host`/`Origin`, so DNS rebinding reaches local servers ([GHSA-w48q](https://github.com/advisories/GHSA-w48q-cv73-mx4w), [GHSA-9h52](https://github.com/advisories/GHSA-9h52-p55h-vw2f), [GHSA-xw59](https://github.com/advisories/GHSA-xw59-hvm2-8pj6)) | One `initialize` with a foreign Host header |
  35. | `mcp-sse-endpoint-unauthenticated` | medium | Legacy HTTP+SSE transport open without credentials | `GET /sse`, reads 32 bytes, disconnects (an endless stream can't hang the scan) |
  36. | `mcp-oauth-protected-resource` | info | RFC 9728 metadata; extracts the authorization servers clients are sent to | `GET /.well-known/oauth-protected-resource[/mcp]` |
  37. **Severity context:** some MCP servers are public by design (documentation search, for example), so check the tool list before calling an unauthenticated server a vulnerability. The rebinding and cross-site templates matter most for servers on localhost and internal networks.
  38. ## How it was tested
  39. - **CI on every push:**
  40. - `nuclei -validate` on all templates.
  41. - Every template runs against three mock MCP servers (`tests/mock_mcp_server.py`): vulnerable, stateless (no session ID, SSE-framed responses, as many hosted servers behave) and hardened (auth + Host/Origin/Content-Type checks). The run fails on any missing **or unexpected** match, and every template must have a positive test.
  42. - **Real-world check:** run against intentionally public servers and OAuth-protected ones:
  43. - DeepWiki and Cloudflare's docs server: detected as unauthenticated (by design), with their 3 and 2 tools listed;
  44. - Notion and Linear: OAuth metadata extracted;
  45. - none of them falsely flagged for cross-site or rebinding.
  46. ## Responsible use
  47. For servers you own or are authorized to test. The templates send the same requests any MCP client sends to start a session (`initialize`, `tools/list`) and **never invoke tools**. Scanning other people's infrastructure without permission may be illegal where you are.
  48. ## Contributing
  49. New templates need a positive and a negative case in `tests/mock_mcp_server.py` / `tests/run_templates.py`. CI enforces both. False-positive reports with the response (redacted) are welcome.
  50. ## License
  51. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.