← Security advisories

Claude MCP skill SSRF — skill webhook delivery and callback notification endpoints — SA-SKL-SSRF44

SA-SKL-SSRF44 documents four SSRF vulnerabilities in MCP skill registry webhook delivery and callback notification endpoints. Webhook systems are inherently SSRF-prone: they accept user-supplied URLs and make server-side HTTP requests to those URLs as part of normal operation. The challenge is constraining those requests to legitimate external webhook receivers while blocking access to internal infrastructure reachable from the registry server's network. All four SA-SKL-SSRF44 patterns fail this constraint, enabling IAM credential theft, internal service topology disclosure, secret leakage via redirect chains, and time-series metric exposure.

SA-SKL-SSRF44 findings at a glance
CRITICALSSRF44-001 — Webhook delivery fetches user-supplied webhookUrl; attacker sets to 169.254.169.254; IAM credentials returned as webhook delivery confirmation response
HIGHSSRF44-002 — Callback notification fetches user-supplied callbackUrl; attacker points to Consul:8500; Consul catalog JSON stored as callback response log exposing internal service topology
HIGHSSRF44-003 — Webhook signature verification fetches user-supplied signingKeyUrl with redirect:follow; CNAME to Vault:8200 returns KV signing keys as HMAC secret material
MEDIUMSSRF44-004 — Event subscription endpoint fetches user-supplied endpointUrl to verify reachability; attacker points to InfluxDB:8086; metrics JSON stored as endpoint verification response

SSRF44-001 — Webhook delivery fetches IMDS, returning IAM credentials

The webhook delivery service fetches the user-supplied webhookUrl to deliver skill event payloads (publish notifications, audit alerts, CI/CD trigger events). When an attacker registers a webhook with webhookUrl set to http://169.254.169.254/latest/meta-data/iam/security-credentials/, the registry server — running on a cloud instance with an attached IAM role — retrieves the IMDS endpoint. The IAM credential response (access key ID, secret access key, session token) is returned as the HTTP response body, which the webhook delivery service logs as the "delivery confirmation response" and potentially displays in the webhook delivery history UI. The attacker reads the credentials from the delivery history or from the exfiltration endpoint they registered as the final delivery target.

SSRF44-001 fix: Implement a webhook URL allowlist restricted to known external webhook receiver hostnames (hooks.slack.com, api.github.com, hooks.zapier.com, webhooks.office.com, and similar). Resolve the hostname before making the request and reject any IP in private, loopback, link-local, or IMDS ranges. Set redirect: 'error' to prevent redirect chains from bypassing the hostname check. Return only the HTTP status code and timestamp in the delivery log — never log or display the response body.

WRONG
// Webhook delivery — fetches any URL, logs full response body
async function deliverWebhook(webhookUrl, payload) {
  const response = await fetch(webhookUrl, {
    method: 'POST',
    body: JSON.stringify(payload),
    headers: { 'Content-Type': 'application/json' }
  });
  const body = await response.text();
  await db.logDelivery(webhookUrl, response.status, body); // stores IMDS response
  return { status: response.status };
}
RIGHT
const WEBHOOK_HOSTNAME_ALLOWLIST = new Set([
  'hooks.slack.com', 'api.github.com', 'hooks.zapier.com',
  'webhooks.office.com', 'notify.pagerduty.com'
]);

function validateWebhookUrl(rawUrl) {
  const url = new URL(rawUrl);
  if (!WEBHOOK_HOSTNAME_ALLOWLIST.has(url.hostname)) {
    throw new Error(`webhook hostname not in allowlist: ${url.hostname}`);
  }
  // Resolve and block private/IMDS IPs
  const ip = dns.lookupSync(url.hostname);
  if (isPrivateOrMetadataIp(ip)) throw new Error('webhook URL resolves to internal IP');
}

async function deliverWebhook(webhookUrl, payload) {
  validateWebhookUrl(webhookUrl);
  const response = await fetch(webhookUrl, {
    method: 'POST',
    body: JSON.stringify(payload),
    headers: { 'Content-Type': 'application/json' },
    redirect: 'error'   // no redirect chains
  });
  // Log only status and timestamp — never the response body
  await db.logDelivery(webhookUrl, response.status, new Date().toISOString());
  return { status: response.status };
}

SSRF44-002 — Callback notification fetches Consul, exposing internal service topology

The callback notification endpoint fetches a user-supplied callbackUrl after completing an asynchronous operation (audit job completion, batch publish result, CI/CD pipeline status). When an attacker sets callbackUrl to http://consul:8500/v1/catalog/services, the registry server retrieves the Consul service catalog, which lists every service registered in the internal service mesh along with their addresses, ports, health check URLs, and metadata tags. This response is stored as the "callback response log" in the registry's database and may be displayed to the attacker in the UI for the job that triggered the callback.

Internal service topology disclosure enables lateral movement planning: the attacker now knows which internal services exist, what ports they listen on, and which are unhealthy (and therefore potentially less monitored). Services named in Consul tags like db-primary, secrets-vault, or auth-service become obvious secondary SSRF targets for follow-on attacks.

SSRF44-002 fix: Restrict callbackUrl to a per-org allowlist of pre-registered CI/CD callback hosts. Set redirect: 'error'. Parse the response with a Zod schema that extracts only status (HTTP status code) and timestamp — never store or return the raw response body.

SSRF44-003 — Signing key fetch follows redirects to Vault, leaking HMAC secrets

The webhook signature verification flow allows skill publishers to supply a signingKeyUrl from which the registry fetches the HMAC signing key used to verify incoming webhook payloads. The fetch is performed with redirect: 'follow' (node-fetch's default). An attacker who controls a DNS record can point signingKeyUrl to a hostname that CNAMEs to vault.internal:8200. The redirect chain resolves to Vault's KV secrets API, which returns the full KV secret bundle including signing keys, API tokens, and other secrets stored at the pointed path. The raw response is stored as the HMAC secret for the webhook configuration.

SSRF44-003 fix: Set redirect: 'error' on the signing key fetch. Restrict signingKeyUrl to an allowlist of known key hosting services. After fetch, extract only the hex or base64 key material from the response using a strict regex — never store the raw response body as the signing secret.

// WRONG — redirect:follow allows CNAME-to-Vault chain
const response = await fetch(signingKeyUrl); // redirect:follow by default
const keyMaterial = await response.text();
await db.saveWebhookSigningKey(webhookId, keyMaterial); // stores full Vault response

// RIGHT — redirect:error; allowlist; regex key extraction
const KEY_HOST_ALLOWLIST = new Set(['keys.skillaudit.dev', 'raw.githubusercontent.com']);
const keyUrl = new URL(signingKeyUrl);
if (!KEY_HOST_ALLOWLIST.has(keyUrl.hostname)) throw new Error('signing key host not allowed');

const response = await fetch(signingKeyUrl, { redirect: 'error' });
const raw = await response.text();
// Extract only 32-64 byte hex or base64 key material
const match = raw.match(/^[0-9a-fA-F]{64}$|^[A-Za-z0-9+/]{43}=$/m);
if (!match) throw new Error('signing key response does not match expected key format');
await db.saveWebhookSigningKey(webhookId, match[0]);

SSRF44-004 — Event subscription verification fetches InfluxDB, exposing metrics

The event subscription endpoint performs a reachability check by fetching the user-supplied endpointUrl before saving the subscription. When an attacker points endpointUrl to http://influxdb:8086/query?q=SHOW+MEASUREMENTS, the registry server retrieves a list of all InfluxDB measurements, which may include internal metric names for database query latencies, service error rates, and infrastructure health indicators. This response is stored as the "endpoint verification response" and returned to the user as confirmation that the endpoint is reachable — inadvertently returning internal metric metadata to the attacker.

SSRF44-004 fix: Restrict endpointUrl to an allowlist of known external CI/CD and notification hostnames. After the reachability check, return only a boolean reachable value and the HTTP status code — never the response body. Use a dedicated IP-range blocklist to prevent requests to internal monitoring and observability services.

Detect SA-SKL-SSRF44 in your registry

SkillAudit scans for user-supplied URL fields in webhook delivery and callback notification handlers, missing hostname allowlists, redirect:follow on key-fetching flows, and response body storage patterns that expose internal service responses across all webhook and event subscription endpoints in your MCP skill registry codebase.

Scan your registry
FindingSeverityFieldInternal targetImpact
SSRF44-001CRITICALwebhookUrlIMDS 169.254.169.254IAM credential theft; cloud account compromise
SSRF44-002HIGHcallbackUrlConsul:8500Internal service topology disclosure; lateral movement planning
SSRF44-003HIGHsigningKeyUrlVault:8200 via CNAMEHMAC secret and KV secret leakage via redirect chain
SSRF44-004MEDIUMendpointUrlInfluxDB:8086Internal metric metadata exposure; infrastructure reconnaissance

See also: SA-SKL-SSRF43 (package registry proxy SSRF patterns) and SA-SKL-INJECTION32 for the companion command injection vulnerabilities in container build endpoints that share the same infrastructure access surface as webhook delivery services.