Claude MCP skill SSRF — skill update notification and auto-upgrade endpoints — SA-SKL-SSRF51
SA-SKL-SSRF51 documents four server-side request forgery vulnerabilities in MCP skill registry update notification and auto-upgrade endpoints. These endpoints manage automated skill updates: notifying configured webhook endpoints when an upgrade completes, checking upstream registries to determine whether newer skill versions are available, fetching changelogs to populate release notes, and calling completion callbacks to signal the end of multi-skill upgrade batches. All four vulnerabilities arise from accepting user-supplied URLs without validation and using the registry server as an HTTP proxy — allowing an attacker to redirect outbound requests to internal metadata services, service mesh control planes, and secret stores that are not reachable from the public internet.
upgradeWebhookUrl; set to 169.254.169.254; IAM credentials embedded in upgrade notification response bodyversionCheckUrl; pointed to Consul:8500; Consul catalog JSON returned verbatim as version check responsechangelogUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as changelog contentcompletionCallbackUrl for each upgraded skill; pointed to etcd:2379; etcd configuration data stored as completion confirmation readable via upgrade history APISSRF51-001 — Auto-upgrade notification webhook fetches user-supplied URL, returning IAM credentials to attacker
When an auto-upgrade completes, the registry server fetches the publisher-configured upgradeWebhookUrl to notify the publisher's CI system that a new skill version is available. The URL is accepted at skill registration time and stored in the skill configuration record without validation. When the upgrade service executes this notification, it makes an outbound HTTP request to the stored URL and embeds the HTTP response body in the upgrade event record as the notification confirmation. An attacker who sets upgradeWebhookUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/ receives the cloud provider's instance metadata service (IMDS) response — the IAM role name — and then uses a second follow-up request to fetch the actual short-lived IAM credentials for that role.
Cloud IMDS credentials returned through SSRF51-001 are typically the credentials attached to the registry server's instance role or pod service account. These credentials have the permissions required for the registry to operate: read/write access to the skill storage bucket, permission to query the registry's RDS or DynamoDB tables, and permission to invoke the Lambda functions or ECS tasks that run the skill audit pipeline. An attacker who obtains these credentials can enumerate the full registry infrastructure, extract skill content from storage, and access the audit pipeline's execution history — including all previous audit reports for every skill in the registry.
SSRF51-001 fix: Maintain an explicit allowlist of approved webhook domains (e.g., hooks.slack.com, api.github.com, known CI provider domains) and reject any upgradeWebhookUrl that does not match. Resolve the hostname via DNS before making the request and block requests to any RFC 1918 address, loopback address, or link-local address (169.254.0.0/16). Set redirect: 'error' to prevent redirect chains to internal hosts. Never store or return the raw response body from the webhook call; record only the HTTP status code and a boolean notified flag.
async function notifyUpgrade(skill, newVersion) {
const resp = await fetch(skill.upgradeWebhookUrl, {
method: 'POST',
body: JSON.stringify({ skillId: skill.id, version: newVersion })
});
// Stores full response body — including IMDS credential response
await db.saveUpgradeEvent(skill.id, { notification: await resp.text() });
}
async function notifyUpgrade(skill, newVersion) {
const url = new URL(skill.upgradeWebhookUrl);
if (!WEBHOOK_DOMAIN_ALLOWLIST.includes(url.hostname)) {
throw new Error(`Rejected webhook domain: ${url.hostname}`);
}
await blockPrivateIp(url.hostname); // DNS check + RFC1918 block
const resp = await fetch(skill.upgradeWebhookUrl, {
method: 'POST',
redirect: 'error',
body: JSON.stringify({ skillId: skill.id, version: newVersion })
});
// Store only status — never the response body
await db.saveUpgradeEvent(skill.id, {
notified: resp.ok,
statusCode: resp.status
});
}
SSRF51-002 — Version check endpoint proxies user-supplied upstream registry URL, returning Consul catalog as version data
The version check endpoint accepts a versionCheckUrl parameter pointing to the upstream registry where newer skill versions should be queried. The endpoint makes an outbound request to this URL, parses the response as a version identifier, and returns the parsed version to the caller. When the URL is set to an internal Consul instance at http://consul.internal:8500/v1/catalog/services, the Consul HTTP API returns a JSON object mapping service names to their registered tags. The version check endpoint passes this response body to the JSON parser, fails to extract a valid version string, and falls back to returning the full raw response — exposing the complete internal service catalog including service names, addresses, and health check configurations.
The Consul service catalog is one of the most valuable SSRF targets in a microservices environment because it provides a complete map of the internal network topology. Every service registered with Consul appears in the catalog with its address, port, and health check endpoint. This map gives an attacker the information needed to plan further SSRF attacks: the exact internal addresses of databases, secret stores, monitoring systems, and admin panels. Combined with the version check endpoint's URL parameter, the attacker can iterate through the catalog, making directed requests to each discovered service to extract configuration data, authentication tokens, and runtime state.
SSRF51-002 fix: Replace the user-supplied versionCheckUrl parameter with an internal lookup: maintain a registry of approved upstream sources for each skill ecosystem (npm, PyPI, GitHub Releases) and select the appropriate one based on the skill's declared package type. Never allow callers to specify an arbitrary fetch URL. If a user-supplied upstream URL is unavoidable, restrict it to an allowlist of approved upstream registry domains and validate the DNS resolution result against a private-IP blocklist. Parse the response with a strict Zod schema that extracts only the version string field — never proxy or return the raw response body.
SSRF51-003 — Changelog fetch with redirect follow enables CNAME-to-Vault secret exfiltration
The changelog fetch endpoint reads the publisher's configured changelogUrl to populate the skill's release notes page in the marketplace. The endpoint makes the fetch request with redirect: 'follow', following up to 20 redirect hops by default. An attacker who controls a DNS zone can create a CNAME chain: attacker-controlled.com resolves to trusted-host.example.com, which resolves to an internal Vault instance at vault.internal:8200. When the fetch follows this chain, the final request reaches Vault and returns key-value secret data as the changelog body. The endpoint stores this content in the marketplace database as the skill's latest release notes, making Vault's KV secrets readable through the public changelog API.
Vault SSRF via changelog fetch is particularly impactful because Vault's HTTP API returns secrets in a predictable JSON envelope that is easy to parse even when stored as opaque changelog text. The /v1/secret/data/ endpoint returns {"data": {"data": {"KEY": "VALUE", ...}}} — a structure that is immediately recognizable when retrieved from the changelog field. Even if the marketplace escapes the content for display, the raw secret values are stored in the database and accessible to any party with database read access or the changelog API.
SSRF51-003 fix: Set redirect: 'error' to disable redirect following entirely. Validate the changelogUrl hostname against an allowlist of approved changelog hosting domains (GitHub raw content URLs, known package registry changelog endpoints). Resolve the hostname before fetching and block any resolution that returns a private IP, loopback, or link-local address. After fetching, validate that the response Content-Type header is text/plain or text/markdown and reject responses with other content types. Extract only the response text body — never store the headers, status line, or any structured data fields from the response.
SSRF51-004 — Completion callback URL stores etcd configuration data in upgrade history readable via API
At the completion of a multi-skill upgrade batch, the auto-upgrade service calls a user-configured completionCallbackUrl for each upgraded skill to signal that the batch upgrade has finished. The service stores the HTTP response body from each callback call in the upgrade history record as a "completion confirmation" field, making it readable through the upgrade history API. When the callback URL is pointed to an internal etcd instance at http://etcd.internal:2379/v2/keys/, etcd returns its key-value configuration store as JSON. This JSON is stored verbatim in the completion confirmation field and becomes readable to any authenticated user who queries the upgrade history for that skill.
etcd stores the cluster configuration for Kubernetes and other distributed systems — including the /registry/secrets/ keyspace that contains all Kubernetes secrets in the cluster. While etcd at port 2379 is typically not directly accessible from external networks, the SSRF path through the upgrade completion callback runs from the registry server's internal network, where etcd is reachable. The etcd configuration data stored in the upgrade history includes database connection strings, service account tokens, TLS certificate private keys, and the registry's own configuration secrets. All of this data becomes readable through the upgrade history API endpoint, which is authenticated but accessible to any registered skill publisher.
SSRF51-004 fix: Restrict the completionCallbackUrl to an allowlist of approved notification domains. Resolve the hostname before fetching and block requests to any private IP range. Set redirect: 'error'. After calling the callback, store only a boolean completed and the ISO timestamp — never the response body. Remove the "completion confirmation" field from the upgrade history API response entirely; it serves no legitimate purpose and creates a persistent SSRF data exfiltration channel.
SkillAudit scans your registry's update notification and auto-upgrade services for all four SSRF51 patterns — IMDS credential exfiltration, internal service catalog disclosure, CNAME-redirect secret fetch, and persistent SSRF via stored response bodies — plus the full SA-SKL-SSRF series. Get started free — 3 audits/month on public repos, results in 60 seconds.