← Blog

Claude MCP skill SSRF — skill notification and alert subscription management endpoints (SA-SKL-SSRF80)

SA-SKL-SSRF80 identifies four server-side request forgery vulnerabilities in MCP skill registry skill notification and alert subscription management endpoints. The notification webhook delivery endpoint fetches the user-supplied notificationWebhookUrl from the application server, allowing an attacker to target 169.254.169.254 and retrieve the instance's IAM role name and full access key, secret access key, and session token from the IMDS metadata service in the notification webhook delivery confirmation response body; the alert subscription callback endpoint fetches the user-supplied alertCallbackUrl, allowing an attacker to point it at an internal Consul:8500 endpoint and receive the full service catalog as the subscription acknowledgment body; the notification digest delivery endpoint fetches the user-supplied digestDeliveryUrl with redirect:follow, allowing an attacker to route via a CNAME chain to Vault:8200 and receive KV secrets in the digest delivery response; and the alert history export endpoint fetches the user-supplied exportUrl and stores the raw HTTP response body as a persistent alert history record, allowing an attacker to target etcd:2379 and store the etcd cluster configuration persistently where it is later retrievable via the public alert history API.

SA-SKL-SSRF80 findings at a glance
CRITICALSSRF80-001 — notification webhook endpoint fetches user-supplied notificationWebhookUrl — attacker sets to 169.254.169.254; IAM credentials in notification webhook delivery confirmation response
CRITICALSSRF80-002 — alert subscription callback endpoint fetches user-supplied alertCallbackUrl — attacker points to Consul:8500; full service catalog as alert subscription acknowledgment body
CRITICALSSRF80-003 — notification digest delivery endpoint fetches user-supplied digestDeliveryUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secrets
HIGHSSRF80-004 — alert history export fetches user-supplied exportUrl and stores raw response as alert history record — attacker points to etcd:2379; etcd config stored persistently via alert history API

SSRF80-001 — Notification webhook SSRF to IMDS returning IAM credentials

The notification webhook delivery worker calls the user-registered notificationWebhookUrl to confirm that the subscriber's endpoint is reachable and accepting notifications. The URL is stored verbatim at subscription registration time and fetched server-side at delivery time without any validation of the target address. An attacker who registers a notification webhook pointing to http://169.254.169.254/latest/meta-data/iam/security-credentials/ receives the instance's IAM role name in the first response, then registers a second webhook to http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> to retrieve the full AccessKeyId, SecretAccessKey, and Token in the delivery confirmation response body.

Vulnerable
// SSRF80-001 — VULNERABLE: unchecked user-supplied webhook URL fetched server-side
async function deliverNotificationWebhook(subscription, event) {
  // notificationWebhookUrl set by user at registration — no validation
  const resp = await fetch(subscription.notificationWebhookUrl, {
    method: 'POST',
    body: JSON.stringify(event),
    headers: { 'Content-Type': 'application/json' }
  });
  // Response body returned to user in delivery confirmation — IMDS credentials exfiltrated here
  return { status: resp.status, body: await resp.text() };
}
Fixed
// SSRF80-001 — FIXED: assertSafeExternalUrl; HEAD-only preflight; never return response body
const { assertSafeExternalUrl } = require('./ssrf-guard');

async function deliverNotificationWebhook(subscription, event) {
  assertSafeExternalUrl(subscription.notificationWebhookUrl);  // throws on private/loopback/IMDS IPs
  const resp = await fetch(subscription.notificationWebhookUrl, {
    method: 'POST',
    body: JSON.stringify(event),
    headers: { 'Content-Type': 'application/json' },
    redirect: 'error'   // prevent redirect chains to internal addresses
  });
  // Return only status code — never response body
  return { status: resp.status };
}

SSRF80-002 — Alert subscription callback SSRF to Consul returning service catalog

The alert subscription acknowledgment flow fetches the user-supplied alertCallbackUrl to verify the subscriber's callback endpoint responds correctly before activating the subscription. An attacker who supplies http://consul.internal:8500/v1/catalog/services as the callback URL receives the registry's complete internal service catalog as the subscription acknowledgment body, revealing internal service names, hostnames, ports, and health check endpoints that the attacker can use to pivot into additional internal targets.

Vulnerable
// SSRF80-002 — VULNERABLE: alertCallbackUrl fetched without validation
async function activateAlertSubscription(subscriptionId, alertCallbackUrl) {
  const probeResp = await fetch(alertCallbackUrl, {
    method: 'GET', headers: { 'X-SkillAudit-Probe': '1' }
  });
  if (probeResp.status !== 200) throw new Error('callback_probe_failed');
  // Returns full response body as acknowledgment — Consul catalog exfiltrated here
  const ackBody = await probeResp.text();
  await db.activateSubscription(subscriptionId, { probeResponseSample: ackBody });
  return { activated: true, probeResponseSample: ackBody };
}
Fixed
// SSRF80-002 — FIXED: assertSafeExternalUrl; redirect:error; return only statusCode
async function activateAlertSubscription(subscriptionId, alertCallbackUrl) {
  assertSafeExternalUrl(alertCallbackUrl);
  const probeResp = await fetch(alertCallbackUrl, {
    method: 'HEAD', headers: { 'X-SkillAudit-Probe': '1' }, redirect: 'error'
  });
  if (probeResp.status !== 200) throw new Error('callback_probe_failed');
  await db.activateSubscription(subscriptionId, { probeStatusCode: probeResp.status });
  return { activated: true };
}

SSRF80-003 — Notification digest delivery SSRF follows CNAME chain to Vault

The notification digest delivery worker fetches the user-supplied digestDeliveryUrl with redirect:follow to deliver a summary digest of recent alerts. An attacker registers a digest delivery URL that points to an attacker-controlled domain which resolves via CNAME to vault.internal:8200. The redirect:follow option means Node.js's fetch will follow the CNAME chain without re-applying the SSRF URL allowlist, allowing the request to reach Vault and return KV secrets in the digest delivery response.

Vulnerable
// SSRF80-003 — VULNERABLE: redirect:follow allows CNAME chain to reach Vault
async function deliverNotificationDigest(subscription, digestPayload) {
  // redirect:follow traverses CNAME chains — bypasses domain-only SSRF check
  const resp = await fetch(subscription.digestDeliveryUrl, {
    method: 'POST', body: JSON.stringify(digestPayload), redirect: 'follow'
  });
  return { status: resp.status, body: await resp.text() };
}
Fixed
// SSRF80-003 — FIXED: assertSafeExternalUrl; redirect:error; return only statusCode
async function deliverNotificationDigest(subscription, digestPayload) {
  assertSafeExternalUrl(subscription.digestDeliveryUrl);
  const resp = await fetch(subscription.digestDeliveryUrl, {
    method: 'POST', body: JSON.stringify(digestPayload), redirect: 'error'
  });
  return { status: resp.status };
}

SSRF80-004 — Alert history export SSRF stores etcd config persistently

The alert history export endpoint fetches the user-supplied exportUrl and stores the raw HTTP response body as a persistent alert history record retrievable via the public alert history API. An attacker who sets exportUrl to http://etcd.internal:2379/v2/keys/?recursive=true stores the entire etcd cluster configuration — including service registration records, distributed lock metadata, and cluster membership state — as a persistent JSON blob in the alert history table. The exported record is then retrievable by any authenticated user via the alert history API, effectively using the registry's own database as an exfiltration cache.

Vulnerable
// SSRF80-004 — VULNERABLE: exportUrl fetched and response stored persistently
async function exportAlertHistory(subscriptionId, exportUrl) {
  const resp = await fetch(exportUrl);
  const rawBody = await resp.text();  // etcd cluster config if exportUrl → etcd
  // Stored persistently — retrievable via GET /api/alerts/history
  await db.query(
    'INSERT INTO alert_history_exports (subscription_id, export_url, export_body) VALUES ($1,$2,$3)',
    [subscriptionId, exportUrl, rawBody]
  );
  return { stored: true };
}
Fixed
// SSRF80-004 — FIXED: assertSafeExternalUrl; HEAD-only; store only URL and statusCode — never response body
async function exportAlertHistory(subscriptionId, exportUrl) {
  assertSafeExternalUrl(exportUrl);
  const resp = await fetch(exportUrl, { method: 'HEAD', redirect: 'error' });
  // Store only the URL and HTTP status — never the response body
  await db.query(
    'INSERT INTO alert_history_exports (subscription_id, export_url, probe_status) VALUES ($1,$2,$3)',
    [subscriptionId, exportUrl, resp.status]
  );
  return { probeStatus: resp.status };
}

SkillAudit detects all SA-SKL-SSRF80 patterns — unchecked user-supplied URLs in webhook and callback delivery flows, redirect-follow SSRF, and persistent response body storage — via static AST analysis and data-flow tracking. Run a free audit on your MCP skill or Claude plugin.