← Security advisories

Claude MCP skill SSRF — skill marketplace and storefront checkout endpoints — SA-SKL-SSRF56

SA-SKL-SSRF56 documents four server-side request forgery vulnerabilities in MCP skill registry marketplace and storefront checkout endpoints. Checkout endpoints are particularly high-value SSRF targets because they legitimately require server-side HTTP requests as part of their workflow — confirming payment completion, verifying subscription state, or notifying external billing systems — which creates natural pressure to accept user-supplied URLs for these callbacks. SSRF56-001 uses the checkout callback URL to exfiltrate EC2 instance metadata credentials. SSRF56-002 uses the payment webhook URL to proxy Consul's service catalog endpoint. SSRF56-003 uses a redirect-following subscription renewal callback to traverse a CNAME chain to a Vault KV store. SSRF56-004 persists etcd configuration data as a refund status record that becomes readable via the order history API.

SA-SKL-SSRF56 findings at a glance
CRITICALSSRF56-001 — checkout session initialization endpoint fetches user-supplied checkoutCallbackUrl to confirm session creation; attacker sets to 169.254.169.254; IAM credentials embedded in checkout confirmation response returned to caller; fix: allowlist; DNS private-IP block; redirect:error; return only HTTP status boolean
CRITICALSSRF56-002 — payment confirmation endpoint fetches user-supplied paymentWebhookUrl to deliver confirmation; attacker points to Consul:8500; Consul catalog JSON returned as payment confirmation containing full internal network topology; fix: allowlist; Zod parse only boolean confirmed; never proxy raw response body
CRITICALSSRF56-003 — subscription renewal endpoint fetches user-supplied renewalCallbackUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as renewal confirmation; fix: redirect:error; allowlist; extract only structured renewal schema
CRITICALSSRF56-004 — refund processing endpoint fetches user-supplied refundStatusUrl for each refund; attacker points to etcd:2379; etcd configuration data stored as refund status record readable via order history API; fix: allowlist; return only boolean refunded; never store raw response body

SSRF56-001 — IAM credential exfiltration via checkout callback URL

Severity: CRITICAL

The checkout session initialization endpoint accepts a user-supplied checkoutCallbackUrl parameter, which the server fetches to confirm that the checkout session was created successfully on the caller's end. The endpoint uses node-fetch with default settings — no URL allowlist, no redirect control, and no hostname validation. Setting checkoutCallbackUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/ causes the server to fetch the EC2 Instance Metadata Service, retrieve the IAM role name, and then follow up with a fetch of the full credentials endpoint. The raw response body — containing AccessKeyId, SecretAccessKey, and Token — is embedded in the checkout confirmation response returned to the caller.

Vulnerable
// checkout.js — user-supplied callback URL with no validation
router.post('/session', requireSession, async (req, res) => {
  const { planId, checkoutCallbackUrl } = req.body;
  const session = await CheckoutSession.create({ userId: req.session.userId, planId });

  // Fetch user-supplied URL — SSRF to 169.254.169.254 possible
  const confirmResp = await fetch(checkoutCallbackUrl, {
    method: 'POST',
    body: JSON.stringify({ sessionId: session.id }),
  });
  const confirmation = await confirmResp.text();

  return res.json({ sessionId: session.id, confirmation }); // IAM creds in confirmation
});
Fixed
// checkout.js — allowlist + DNS block + return only boolean
const ALLOWED_CALLBACK_ORIGINS = new Set(process.env.CHECKOUT_CALLBACK_ORIGINS.split(','));

function isAllowedCallbackUrl(url) {
  try {
    const parsed = new URL(url);
    if (!ALLOWED_CALLBACK_ORIGINS.has(parsed.origin)) return false;
    if (/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|169\.254\.|127\.|::1|fc00:|fe80:)/i
        .test(parsed.hostname)) return false;
    return true;
  } catch { return false; }
}

router.post('/session', requireSession, async (req, res) => {
  const { planId, checkoutCallbackUrl } = req.body;
  if (!isAllowedCallbackUrl(checkoutCallbackUrl)) {
    return res.status(400).json({ error: 'Invalid callback URL' });
  }
  const session = await CheckoutSession.create({ userId: req.session.userId, planId });
  const resp = await fetch(checkoutCallbackUrl, {
    method: 'POST',
    redirect: 'error', // no redirect following
    body: JSON.stringify({ sessionId: session.id }),
    signal: AbortSignal.timeout(3000),
  });
  return res.json({ sessionId: session.id, confirmed: resp.ok }); // boolean only
});

SSRF56-002 — Consul topology exfiltration via payment webhook URL

Severity: CRITICAL

The payment confirmation endpoint accepts a user-supplied paymentWebhookUrl and proxies the full raw response body back to the caller as the payment confirmation payload. Setting this URL to http://consul-server:8500/v1/catalog/services causes the server to fetch Consul's service catalog endpoint and return the full JSON response — a complete map of every registered internal service including their health check endpoints, metadata tags, and service addresses — as the "payment confirmation" that the API returns to the user. This response is immediately accessible via the payment history endpoint, persisting the internal topology data beyond the initial request.

Vulnerable
// payment.js — raw response body proxied back to caller
const webhookResp = await fetch(paymentWebhookUrl, { method: 'POST', body: confirmPayload });
const webhookBody = await webhookResp.json(); // attacker gets full Consul catalog
return res.json({ status: 'confirmed', webhookResponse: webhookBody }); // proxied to caller
Fixed
// payment.js — allowlist + return only boolean confirmed
if (!isAllowedCallbackUrl(paymentWebhookUrl)) {
  return res.status(400).json({ error: 'Invalid webhook URL' });
}
const webhookResp = await fetch(paymentWebhookUrl, {
  method: 'POST', redirect: 'error',
  body: confirmPayload, signal: AbortSignal.timeout(3000),
});
// Never proxy response body — return only delivery status boolean
return res.json({ status: 'confirmed', webhookDelivered: webhookResp.ok });

SSRF56-003 — Vault KV secret exfiltration via CNAME redirect chain in subscription renewal

Severity: CRITICAL

The subscription renewal endpoint fetches the user-supplied renewalCallbackUrl with redirect: 'follow' and no maximum redirect depth. An attacker registers a domain they control whose CNAME chain resolves to an internal Vault instance running on port 8200. When the subscription renewal endpoint fetches https://attacker-redirect.example.com/vault-proxy, the server follows the CNAME chain, reaches http://vault-internal:8200/v1/secret/data/registry-config, and receives the Vault KV store response containing database passwords, API keys, and signing secrets. The raw response is embedded in the renewal confirmation that the API returns to the subscription owner.

The fix sets redirect: 'error' to prevent all redirect following — DNS-based SSRF bypasses hostname-only allowlists precisely because the redirect destination is not visible at request time, so the only defense is to disable redirects entirely and require that callers supply the final destination URL directly. The response handling extracts only the structured fields defined in the renewal schema rather than proxying raw body content.

SSRF56-004 — etcd configuration data persisted as refund status record

Severity: CRITICAL

The refund processing endpoint fetches the user-supplied refundStatusUrl for each refund request to verify the refund outcome with the payment processor, then stores the raw response body as the refund status record in the order history table. Setting refundStatusUrl to http://etcd-server:2379/v3/kv/range causes the server to fetch etcd's key-value range endpoint and store the full response — containing cluster configuration, service credentials, and feature flag data — as a refund status record. This record is readable via the order history API endpoint, which requires only a valid user session to access, making the internal configuration data available to any authenticated user who queries their order history after the SSRF is triggered.

The persistence of the exfiltrated data is what makes SSRF56-004 more impactful than a simple SSRF: the attacker does not need to intercept the response in real time. They can submit the crafted refund request, wait for the status URL to be fetched, then read the exfiltrated data at any time by querying their order history. The fix returns only a boolean refunded field extracted from the response status code rather than storing or proxying any part of the response body.

Vulnerable
// refund.js — stores raw SSRF response body as refund status record
const statusResp = await fetch(refundStatusUrl);
const statusBody = await statusResp.text(); // attacker gets full etcd response
await RefundRecord.updateOne(
  { refundId },
  { status: statusBody }, // etcd data stored in DB, readable via order history
);
Fixed
// refund.js — allowlist + store only boolean refunded
if (!isAllowedCallbackUrl(refundStatusUrl)) {
  return res.status(400).json({ error: 'Invalid refund status URL' });
}
const statusResp = await fetch(refundStatusUrl, {
  redirect: 'error', signal: AbortSignal.timeout(3000),
});
await RefundRecord.updateOne(
  { refundId },
  { refunded: statusResp.status === 200 }, // boolean only — never store raw body
);

Remediation summary

FindingTargetPrimary remediationKey fix detail
SSRF56-001IMDS / IAMAllowlist callback origins; DNS private-IP block; redirect:error; return boolean onlyBlock 169.254.0.0/16 at DNS resolution; never embed fetch response body in API response
SSRF56-002Consul:8500Allowlist webhook origins; redirect:error; return boolean only; never proxy raw webhook responseExtract only z.boolean().parse(resp.ok) from webhook delivery
SSRF56-003Vault:8200redirect:error on all outbound fetches; allowlist; extract only structured renewal schema fieldsDNS CNAME chains bypass hostname checks — redirect:error is the only reliable defense
SSRF56-004etcd:2379Allowlist; redirect:error; store only boolean refunded; never store raw response bodyPersistent storage of SSRF response bodies creates persistent data exfiltration via API reads

SkillAudit scans checkout and payment endpoints for all four SA-SKL-SSRF56 patterns. See also SA-SKL-SSRF55 and SA-SKL-SSRF54. Connect your repository at skillaudit.dev.