← Security advisories

Claude MCP skill SSRF — skill installation and deployment pipeline endpoints — SA-SKL-SSRF50

SA-SKL-SSRF50 documents four critical server-side request forgery vulnerabilities in MCP skill registry installation and deployment pipeline endpoints. These endpoints accept user-supplied callback and verification URLs as part of legitimate install notification, deployment readiness checking, install verification, and deployment health monitoring workflows. SSRF50-001 exploits the post-install hook URL to reach the cloud instance metadata service and exfiltrate IAM credentials embedded directly in the install notification response. SSRF50-002 targets the deployment target URL parameter to reach Consul's service catalog API, returning internal service registration data as the deployment readiness check result. SSRF50-003 leverages the install verification URL with unrestricted redirect following to chain through a CNAME to Vault's KV secrets API, surfacing stored secrets as the verification response. SSRF50-004 uses the deployment health check URL to reach etcd's configuration store, persisting etcd configuration data in the deployment history API where it remains readable by any authenticated user.

SA-SKL-SSRF50 findings at a glance
CRITICALSSRF50-001 — skill installation endpoint fetches user-supplied postInstallHookUrl to notify install completion; attacker sets to 169.254.169.254; IAM credentials embedded in install notification response
CRITICALSSRF50-002 — deployment pipeline endpoint fetches user-supplied deploymentTargetUrl to verify deployment readiness; attacker points to Consul:8500; Consul catalog JSON returned as deployment readiness check; fix: allowlist; Zod parse only readiness boolean; never proxy raw response body
CRITICALSSRF50-003 — install verification endpoint fetches user-supplied verifyUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as install verification result; fix: redirect:error; allowlist; extract only boolean verified and HTTP status
HIGHSSRF50-004 — deployment health check endpoint fetches user-supplied healthCheckUrl for each deployed skill; attacker points to etcd:2379; etcd configuration data stored as health check result readable via deployment history API

SSRF50-001 — postInstallHookUrl SSRF to IMDS exfiltrates IAM credentials in install notification response

The skill installation endpoint accepts a postInstallHookUrl parameter that specifies a callback URL to notify when the install completes. The registry server fetches this URL from its own network — which runs inside the cloud provider's VPC — and embeds the response body in the install notification event that is returned to the requesting client. When an attacker supplies http://169.254.169.254/latest/meta-data/iam/security-credentials/ as the hook URL, the registry server fetches the AWS instance metadata service from within the VPC, receives the list of attached IAM role names, and embeds that response in the install event. A second request to http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> returns the full IAM credential set — AccessKeyId, SecretAccessKey, and SessionToken — embedded in the install notification response body returned to the client.

These IAM credentials belong to the registry service's deployment role, which typically carries permissions to read from and write to the artifact storage bucket, push images to the container registry, describe EC2 instances and ECS tasks, and read secrets from Secrets Manager. With these credentials, an attacker can exfiltrate all artifacts in the registry storage bucket, inject malicious content into existing skill artifacts, or use the Secrets Manager access to retrieve database passwords and API keys used by the registry service itself. The credentials are valid until the token expires (usually one hour for temporary credentials) and can be refreshed by repeating the IMDS fetch, giving the attacker a persistent access window.

SSRF50-001 fix: Validate postInstallHookUrl against an allowlist of known CI/notification domains before fetching. Block requests to any URL whose resolved IP falls within RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), the link-local range (169.254.0.0/16), or localhost before initiating the fetch. Set redirect: 'error' to prevent redirect chains to internal addresses. Store only the HTTP status code and a boolean notified flag from the hook response — never embed the response body in any client-readable event or log.

WRONG
async function notifyPostInstall(installEvent, hookUrl) {
  // No validation — hookUrl may be 169.254.169.254
  const resp = await fetch(hookUrl, {
    method: 'POST',
    body: JSON.stringify(installEvent)
  });
  // Response body embedded in install event — IAM creds exfiltrated
  const hookResponse = await resp.text();
  return { notified: true, hookResponse };
}
RIGHT
async function notifyPostInstall(installEvent, hookUrl) {
  // Validate against allowlist of approved notification domains
  assertAllowlistedDomain(hookUrl, NOTIFICATION_DOMAIN_ALLOWLIST);
  // Block private/link-local IPs at DNS resolution time
  await assertPublicIp(hookUrl);
  const resp = await fetch(hookUrl, {
    method: 'POST',
    body: JSON.stringify(installEvent),
    redirect: 'error'   // reject any redirect chain
  });
  // Return only status — never embed response body
  return { notified: resp.ok, status: resp.status };
}

SSRF50-002 — deploymentTargetUrl SSRF to Consul:8500 returns internal service catalog as readiness check result

The deployment pipeline endpoint accepts a deploymentTargetUrl parameter specifying where to send a readiness probe before marking a deployment as ready. The endpoint fetches that URL, parses the response as a JSON readiness document with a boolean ready field, and returns the parsed readiness status to the deployment orchestration client. When an attacker supplies http://consul.service.internal:8500/v1/catalog/services as the deployment target URL, the registry server fetches Consul's catalog API from within the VPC, receives the full JSON object mapping every registered service name to its health check tags, and returns this document as the deployment readiness response body. Even if the endpoint attempts to parse only the ready field, error handling paths that return the raw response on parse failure expose the full Consul catalog to the client.

The Consul service catalog is a high-value reconnaissance target: it lists every service registered with the mesh, their internal DNS names, health check endpoints, and tag metadata that often includes deployment environment, version, and infrastructure tier information. With this catalog, an attacker can identify every internal service that the registry infrastructure depends on — databases, caches, internal API gateways, and security services — and their internal addresses, feeding subsequent SSRF or lateral movement attacks.

SSRF50-002 fix: Validate deploymentTargetUrl against an allowlist of approved deployment target domains. Block private IP ranges and link-local addresses. After fetching, use Zod to parse only the boolean ready field from the response: DeploymentReadinessSchema = z.object({ ready: z.boolean() }). Discard the raw response body entirely after parsing — never return it to the client, never log it, and never store it. If the response does not parse as a valid readiness document, return a generic { ready: false, reason: 'invalid_response' } without exposing any part of the raw body.

SSRF50-003 — verifyUrl with redirect:follow enables CNAME chain to Vault:8200 returning KV secrets as verification result

The install verification endpoint accepts a verifyUrl parameter and fetches it to confirm that the installed skill's backing service is reachable and returns a valid verification response. The fetch is performed with redirect: 'follow', which allows the HTTP client to follow redirect chains across domain boundaries. An attacker can register a domain they control, configure a CNAME record pointing to vault.service.internal, and supply that domain as the verifyUrl. When the registry server fetches the attacker's domain, the CNAME resolution directs the connection to Vault's internal address, and Vault's HTTP API responds at /v1/kv/data/ with key-value secret listings. The registry embeds this response in the install verification result returned to the client, exposing stored secrets including database passwords, API keys, and certificate private keys stored in Vault's KV engine.

The CNAME-chained SSRF bypasses naive hostname-based allowlists because the initial URL hostname belongs to a legitimately registered domain. Only DNS-resolved IP address checking at the time of the actual TCP connection — after CNAME resolution is complete — can reliably detect and block this bypass technique. The verification flow's expectation of a JSON response means the attacker also needs Vault to return usable JSON, but Vault's KV API always responds with structured JSON, making it an ideal SSRF target for this pattern.

SSRF50-003 fix: Set redirect: 'error' on all verification fetch calls — this prevents any redirect chain, CNAME-based or otherwise, from reaching internal addresses. Validate verifyUrl against an allowlist of known skill deployment domains. After DNS resolution and before TCP connection, verify that the resolved IP is not in a private or link-local range. Parse the response with Zod to extract only a boolean verified field and the HTTP status code — discard the raw response body completely.

WRONG
async function verifyInstall(verifyUrl) {
  // redirect:follow allows CNAME chain to internal Vault endpoint
  const resp = await fetch(verifyUrl, { redirect: 'follow' });
  // Raw response body returned — Vault KV secrets exfiltrated
  const body = await resp.json();
  return { verified: resp.ok, result: body };
}
RIGHT
async function verifyInstall(verifyUrl) {
  assertAllowlistedDomain(verifyUrl, DEPLOYMENT_DOMAIN_ALLOWLIST);
  await assertPublicIp(verifyUrl);  // checks after CNAME resolution
  const resp = await fetch(verifyUrl, {
    redirect: 'error'  // block all redirects including CNAME chains
  });
  const raw = await resp.json();
  // Extract only the boolean — never return raw body to caller
  const parsed = VerifyResultSchema.safeParse(raw);
  return {
    verified: parsed.success && parsed.data.verified,
    status: resp.status
  };
}

SSRF50-004 — healthCheckUrl SSRF to etcd:2379 stores configuration data in deployment history readable by all authenticated users

The deployment health check endpoint fetches a user-supplied healthCheckUrl for each deployed skill to verify that the skill's backing service is responding correctly. The raw health check response body is persisted to the deployment history record as a lastHealthCheckResponse field, making it available to any authenticated user who queries the deployment history API. When an attacker points healthCheckUrl to http://etcd.service.internal:2379/v3/kv/range, the registry fetches etcd's range API, receives a JSON object containing key-value configuration entries for all services that use etcd for configuration storage, and stores this data verbatim in the deployment history. Any user with read access to deployment history — typically all authenticated registry users — can retrieve the etcd configuration dump by querying the deployment history for the targeted skill.

The persistence of the exfiltrated data in the deployment history database is what elevates SSRF50-004 above a simple SSRF: even after the vulnerable endpoint is patched, the previously stored etcd configuration data remains in historical deployment records until explicitly purged. Organizations that retain deployment history for audit or debugging purposes may keep these records for months or years, extending the window during which the etcd configuration data is accessible to any authenticated user who knows where to look.

SSRF50-004 fix: Validate healthCheckUrl against an allowlist of approved deployment target domains. Block private IP ranges. After fetching, store only a boolean healthy and the round-trip latency in the deployment history record — never store any part of the raw response body. Apply a migration to purge existing lastHealthCheckResponse fields from historical deployment records and redeploy with the sanitized storage schema before patching the endpoint validation alone.

SkillAudit scans your registry's installation and deployment pipeline endpoints for all four SSRF50 patterns, plus the other SSRF families documented in the SA-SKL-SSRF series. Get started free — 3 audits/month on public repos, results in 60 seconds.