robots.txt enforcement bypass via HTTP redirects in mcp-server-fetch
GHSA-3jqg-r5pp-rmp2 · published 2026-10-25
- Severity
- Low
- CVSS score
- 3.1
- Chance of exploitation (EPSS)
- No CVE
- Fixed in
- 2026.10.24
Anyone running mcp-server-fetch with robots.txt enforcement on (the default), for fetches the model makes through the fetch tool. The fetch prompt skips robots.txt by design and is not affected. The attacker needs a URL the model will fetch and that the robots.txt check lets through: a page they host on a host with no robots.txt or a permissive one, answering with a redirect. A site can also trip it without any attacker, with an ordinary redirect from an allowed path to a disallowed one. In both cases the final URL is never checked against the robots.txt of the host it ends up on. …
Upgrade mcp-server-fetch to 2026.10.24 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.
Check robots.txt in a second request hook, for every request after the first (the handler has already checked the first one), and only when the caller asked for robots.txt enforcement: The fetch prompt and --ignore-robots-txt don't pass the flag, so they behave as before. Behaviour change to be aware of: one extra robots.txt request per redirect hop, same-host hops included (I didn't add caching, to keep the diff small), and a redirect target whose robots.txt can't be fetched or answers 401/403 now fails the fetch, the same way it already does for the requested URL. The full patch also adds four tests to tests/test_protocol.py and changes the assertion quoted above. …
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| mcp-server-fetch | PyPI | >= 0.6.1, <= 2026.10.19 | 2026.10.24 |
- CriticalLiteLLM has SQL Injection in Proxy API key verificationlitellmExploited
- Criticaln8n Vulnerable to Remote Code Execution via Expression Injectionn8nExploited
- HighLiteLLM has a sandbox escape in custom-code guardraillitellmExploited
- HighLangflow affected by Remote Code Execution via validate_code() exec()langflowExploited
- Criticalgit_add runs submodule filter commands when gitlink mode is not 160000mcp-server-git
- Criticalmcp-server-git: unexpandable sparse index lets submodule filter drivers runmcp-server-git
- Mediumfetch: small page OOMs the server during HTML-to-Markdown conversionmcp-server-fetch
- Mediumfetch: robots.txt User-agent groups cause quadratic memory blowupmcp-server-fetch
- Mediumfetch: private-address guard bypass via IDNA hostnames (check and connect resolve different names)mcp-server-fetch
- Lowfetch: robots.txt is ignored when it starts with a UTF-8 BOMmcp-server-fetch
- Lowfetch: punycode charset in Content-Type hangs the server for 16 minmcp-server-fetch
- LowIncomplete fix for GHSA-3rxj-6jhw-qfv7: robots.txt path normalisation in mcp-server-fetch still misses backslash and path-parameter spellingmcp-server-fetch
The impact, patch and workaround text comes from the advisory, shortened (published by the MCP reference servers project). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.