← Blog

Claude MCP skill SSRF — skill CDN cache management and asset delivery webhook endpoints (SA-SKL-SSRF87)

SA-SKL-SSRF87 identifies four server-side request forgery vulnerabilities in MCP skill registry skill CDN cache management and asset delivery webhook endpoints. SSRF87-001 exploits the CDN cache purge callback endpoint, which fetches a user-supplied cdnPurgeCallbackUrl to notify the caller that the cache purge completed — an attacker sets this URL to the EC2 Instance Metadata Service address 169.254.169.254/latest/meta-data/iam/security-credentials/ and receives the registry host's IAM role credentials including temporary access key, secret key, and session token in the purge callback response body. SSRF87-002 exploits the asset delivery webhook endpoint, which fetches a user-supplied assetDeliveryWebhookUrl to acknowledge that an asset has been delivered to its CDN edge node — an attacker points this URL to an internal Consul instance at port 8500 and receives the full service catalog including internal service addresses, health check endpoints, and tagged metadata as the webhook acknowledgment body. SSRF87-003 exploits the CDN prefetch endpoint, which fetches a user-supplied cdnPrefetchUrl with redirect following enabled — an attacker registers a DNS CNAME that resolves to vault.internal:8200 and uses it as the prefetch URL, with the redirect chain returning Vault KV secrets from the internal secrets store. SSRF87-004 exploits the asset import endpoint, which fetches a user-supplied assetImportUrl and stores the raw HTTP response body as an asset record in the registry database — an attacker points this URL to an internal etcd instance at port 2379, which returns the full etcd configuration including all stored keys, and this configuration is then persistently stored and queryable through the asset history API.

SA-SKL-SSRF87 findings at a glance
CRITICALSSRF87-001 — CDN cache purge callback endpoint fetches user-supplied cdnPurgeCallbackUrl — attacker sets to 169.254.169.254; IAM credentials in CDN purge callback response body
CRITICALSSRF87-002 — asset delivery webhook endpoint fetches user-supplied assetDeliveryWebhookUrl — attacker points to Consul:8500; full service catalog as asset delivery webhook acknowledgment body
CRITICALSSRF87-003 — CDN prefetch endpoint fetches user-supplied cdnPrefetchUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secrets
HIGHSSRF87-004 — asset import endpoint fetches user-supplied assetImportUrl and stores raw response as asset record — attacker points to etcd:2379; etcd config stored persistently via asset history API

SSRF87-001 — CDN purge callback URL fetches IMDS IAM credentials

The CDN cache purge endpoint accepts a cdnPurgeCallbackUrl parameter specifying where to POST a completion notification after the cache purge job finishes. This callback mechanism is intended to notify external CDN management systems, but the endpoint makes no distinction between external and internal addresses. An attacker who can trigger a cache purge — available to any authenticated skill publisher — sets cdnPurgeCallbackUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-worker-role. The registry worker's HTTP client fetches this URL, which returns the IAM role's temporary credentials — including AccessKeyId, SecretAccessKey, and Token — and includes the response body verbatim in the callback result that is returned to the attacker. These credentials provide the attacker with AWS API access under the registry worker's IAM role for the duration of the credential TTL, typically one hour, enabling S3 access, DynamoDB access, and any other AWS service permissions granted to the role.

Vulnerable
// SSRF87-001 — VULNERABLE: cdnPurgeCallbackUrl fetches IMDS
const fetch = require('node-fetch');
const { cdnClient } = require('../cdn');

async function purgeCDNCache(skillId, assetPaths, cdnPurgeCallbackUrl) {
  const result = await cdnClient.purge(skillId, assetPaths);
  if (cdnPurgeCallbackUrl) {
    // attacker sets cdnPurgeCallbackUrl = 'http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-worker-role'
    const callbackResp = await fetch(cdnPurgeCallbackUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ purgedPaths: assetPaths, completedAt: new Date() })
    });
    return { result, callbackStatus: callbackResp.status, callbackBody: await callbackResp.text() };
  }
  return { result };
}

IAM role credentials returned from the IMDS provide full AWS API access under the registry worker's permissions — an attacker who exfiltrates them can read all S3 assets, write to DynamoDB, and enumerate all AWS resources accessible to the role for the credential TTL period. assertSafeExternalUrl() blocks RFC 1918, loopback, and link-local addresses including 169.254.169.254; redirect: 'error' prevents redirect chains from bypassing allowlist checks; returning only the HTTP status code from the callback prevents response body exfiltration.

Fixed
// SSRF87-001 — FIXED: assertSafeExternalUrl(); redirect:error; return only statusCode
const fetch = require('node-fetch');
const { cdnClient } = require('../cdn');
const { assertSafeExternalUrl } = require('../security/ssrf');

async function purgeCDNCache(skillId, assetPaths, cdnPurgeCallbackUrl) {
  const result = await cdnClient.purge(skillId, assetPaths);
  if (cdnPurgeCallbackUrl) {
    assertSafeExternalUrl(cdnPurgeCallbackUrl);
    const callbackResp = await fetch(cdnPurgeCallbackUrl, {
      method: 'POST',
      redirect: 'error',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ purgedPaths: assetPaths, completedAt: new Date() })
    });
    return { result, callbackStatus: callbackResp.status };
  }
  return { result };
}

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N — Base Score 9.0 (CRITICAL); scope changed because IAM credential exfiltration extends impact to all AWS services accessible to the registry worker role.

SSRF87-002 — Asset delivery webhook URL fetches Consul service catalog

The asset delivery confirmation endpoint accepts an assetDeliveryWebhookUrl parameter specifying where to POST a webhook confirming that the asset has been delivered to the CDN edge node. This webhook mechanism is intended to notify external build systems and CI pipelines, but the endpoint makes no distinction between external and internal addresses. An attacker who can trigger an asset delivery — available to any authenticated skill publisher uploading skill assets — sets assetDeliveryWebhookUrl to http://consul.internal:8500/v1/catalog/services. The registry worker's HTTP client fetches this URL, which returns the full Consul service catalog as a JSON object including internal service names, tagged metadata, and all registered node addresses. The response body is included in the webhook acknowledgment returned to the attacker, exposing the complete internal service topology — database hostnames, Redis cluster members, internal API service addresses, and any other services registered with Consul. This catalog is immediately actionable for lateral movement targeting against services that lack network-level isolation from the registry worker.

Vulnerable
// SSRF87-002 — VULNERABLE: assetDeliveryWebhookUrl fetches Consul:8500
const fetch = require('node-fetch');

async function confirmAssetDelivery(skillId, assetId, edgeNode, assetDeliveryWebhookUrl) {
  const payload = { skillId, assetId, edgeNode, deliveredAt: new Date() };
  if (assetDeliveryWebhookUrl) {
    // attacker sets assetDeliveryWebhookUrl = 'http://consul.internal:8500/v1/catalog/services'
    const resp = await fetch(assetDeliveryWebhookUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload)
    });
    return { delivered: true, webhookStatus: resp.status, webhookBody: await resp.text() };
  }
  return { delivered: true };
}

The Consul service catalog maps the entire internal service topology — an attacker who exfiltrates it has a complete lateral movement blueprint for targeting every internal service accessible from the registry worker network. assertSafeExternalUrl() blocks internal DNS names resolving to RFC 1918 addresses; HEAD-only method prevents response body exfiltration; returning only the HTTP status code eliminates the response body exfiltration channel entirely.

Fixed
// SSRF87-002 — FIXED: assertSafeExternalUrl(); HEAD-only; return only statusCode
const fetch = require('node-fetch');
const { assertSafeExternalUrl } = require('../security/ssrf');

async function confirmAssetDelivery(skillId, assetId, edgeNode, assetDeliveryWebhookUrl) {
  if (assetDeliveryWebhookUrl) {
    assertSafeExternalUrl(assetDeliveryWebhookUrl);
    const resp = await fetch(assetDeliveryWebhookUrl, {
      method: 'HEAD',
      redirect: 'error'
    });
    return { delivered: true, webhookStatus: resp.status };
  }
  return { delivered: true };
}

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N — Base Score 7.7 (HIGH); scope changed because service catalog exfiltration enables lateral movement beyond the registry system boundary.

SSRF87-003 — CDN prefetch URL with redirect:follow CNAME chains to Vault

The CDN prefetch endpoint accepts a cdnPrefetchUrl parameter specifying which URL to warm into the CDN edge cache ahead of an anticipated traffic spike. The endpoint fetches this URL with redirect following enabled to handle CDN-level redirects that map canonical asset paths to versioned CDN URLs. An attacker exploits this redirect following by registering a DNS CNAME record that resolves to an internal Vault instance at vault.internal:8200. When the registry worker follows the redirect chain to the CNAME target, it reaches the Vault HTTP API and returns KV secrets including database credentials, API keys, and signing certificates stored in the Vault KV store. Because the redirect following is unrestricted, any CNAME that ultimately resolves to an internal host bypasses the initial URL allowlist check that validates only the initial hostname before the first redirect is followed. This DNS rebinding and CNAME-chain variant of SSRF is particularly difficult to detect because the initial URL appears to be a legitimate external CDN hostname.

Vulnerable
// SSRF87-003 — VULNERABLE: cdnPrefetchUrl with redirect:follow allows CNAME to Vault
const fetch = require('node-fetch');

async function prefetchCDNAsset(skillId, cdnPrefetchUrl) {
  // attacker registers CNAME: attacker-cdn.com -> vault.internal:8200
  // cdnPrefetchUrl = 'http://attacker-cdn.com/v1/secret/data/registry-credentials'
  const resp = await fetch(cdnPrefetchUrl, {
    method: 'GET',
    redirect: 'follow'  // follows CNAME chain to vault.internal:8200
  });
  return { status: resp.status, prefetchedUrl: cdnPrefetchUrl, body: await resp.text() };
}

redirect:follow with no post-redirect hostname validation allows CNAME chains to bypass initial URL allowlist checks — the security check runs against the attacker-controlled external hostname, not the internal target the redirect resolves to. Setting redirect: 'error' prevents all redirect following and eliminates the CNAME chain attack vector entirely; assertSafeExternalUrl() provides defense-in-depth against direct internal URL submission; returning only the HTTP status code prevents response body exfiltration from the Vault API.

Fixed
// SSRF87-003 — FIXED: assertSafeExternalUrl(); redirect:error; return only statusCode
const fetch = require('node-fetch');
const { assertSafeExternalUrl } = require('../security/ssrf');

async function prefetchCDNAsset(skillId, cdnPrefetchUrl) {
  assertSafeExternalUrl(cdnPrefetchUrl);
  const resp = await fetch(cdnPrefetchUrl, {
    method: 'GET',
    redirect: 'error'
  });
  return { status: resp.status, prefetchedUrl: cdnPrefetchUrl };
}

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N — Base Score 7.7 (HIGH); scope changed because Vault KV exfiltration provides credentials for systems beyond the registry boundary; CNAME technique makes detection difficult.

SSRF87-004 — Asset import URL fetches etcd and stores configuration persistently

The asset import endpoint accepts an assetImportUrl parameter specifying where to fetch an asset file for import into the skill's asset library. The endpoint fetches the URL and stores the raw HTTP response body as an asset record in the registry database, making it available through the asset history and download API. An attacker who can trigger an asset import — available to any authenticated skill publisher — sets assetImportUrl to http://etcd.internal:2379/v3/keys?recursive=true. The registry worker fetches this URL, which returns the full etcd key-value store including all stored configuration keys, TLS certificates, cluster membership records, and any application secrets stored in etcd. Because the response is stored as an asset record in the registry database, the attacker can retrieve it at any time through the asset history API — even after the etcd response TTL would have expired — and can share the asset download URL with collaborators. The persistence of the exfiltrated data in the registry database means that rotating the etcd credentials does not remediate the exposure: the historical snapshot remains queryable.

Vulnerable
// SSRF87-004 — VULNERABLE: assetImportUrl fetches etcd and stores response persistently
const fetch = require('node-fetch');
const { db } = require('../db');

async function importSkillAsset(skillId, assetImportUrl, assetName) {
  // attacker sets assetImportUrl = 'http://etcd.internal:2379/v3/keys?recursive=true'
  const resp = await fetch(assetImportUrl);
  const body = await resp.buffer();
  const assetId = await db.storeAsset({
    skillId,
    name: assetName,
    content: body,          // etcd full key-value dump stored in registry DB
    sourceUrl: assetImportUrl,
    importedAt: new Date()
  });
  return { assetId, size: body.length };
}

Storing the SSRF response body persistently in the registry database means that rotating etcd credentials does not remediate the exposure — the historical snapshot remains accessible through the asset history API indefinitely. assertSafeExternalUrl() blocks internal DNS names; HEAD-only method verifies the URL is reachable without fetching the response body; storing only the validated source URL and the HTTP status code from the HEAD probe eliminates the body exfiltration and persistence vector entirely.

Fixed
// SSRF87-004 — FIXED: assertSafeExternalUrl(); HEAD-only; store only URL and probeStatusCode
const fetch = require('node-fetch');
const { db } = require('../db');

async function importSkillAsset(skillId, assetImportUrl, assetName) {
  assertSafeExternalUrl(assetImportUrl);
  const probe = await fetch(assetImportUrl, {
    method: 'HEAD',
    redirect: 'error'
  });
  const assetId = await db.storeAssetReference({
    skillId,
    name: assetName,
    sourceUrl: assetImportUrl,
    probeStatusCode: probe.status,
    importedAt: new Date()
  });
  return { assetId, probeStatus: probe.status };
}

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N — Base Score 8.1 (HIGH); scope changed because etcd exfiltration extends to cluster infrastructure; integrity impact because persistent storage of exfiltrated data creates a permanent secondary exposure path.

Scan your MCP skill for SSRF87 and 200+ other vulnerability classes

SkillAudit checks for all SA-SKL-SSRF vulnerability patterns including user-supplied callback URLs fetching IMDS credentials, webhook URLs reaching internal service discovery, CDN prefetch URLs with unrestricted redirect following, and asset import URLs with persistent response storage. Get a graded report with line-level code fixes in 60 seconds.

Get a free audit