← Security advisories

Claude MCP skill SSRF — skill integration webhook and callback delivery endpoints — SA-SKL-SSRF58

SA-SKL-SSRF58 documents four SSRF vulnerabilities in MCP skill registry skill integration webhook and callback delivery endpoints. These endpoints accept user-supplied URLs to deliver webhook payloads, confirm callback receipt, verify integration health, and replay historical events. When URL validation is absent, attackers redirect these server-side fetch operations to internal metadata services, secrets managers, and configuration stores — extracting credentials and topology data that enables lateral movement through the registry infrastructure.

SA-SKL-SSRF58 findings at a glance
CRITICALSSRF58-001 — integration webhook dispatch endpoint fetches user-supplied webhookDeliveryUrl — attacker sets to 169.254.169.254; IAM credentials embedded in webhook delivery confirmation response returned to caller; fix: allowlist; DNS private-IP block; redirect:error; return only HTTP status boolean
CRITICALSSRF58-002 — callback confirmation endpoint fetches user-supplied callbackConfirmationUrl — attacker points to Consul:8500; Consul catalog JSON returned as callback confirmation containing full internal network topology; fix: allowlist; Zod parse only boolean confirmed; never proxy raw response body
CRITICALSSRF58-003 — integration health check endpoint fetches user-supplied healthCheckUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secrets as health check result; fix: redirect:error; allowlist; extract only structured health schema
HIGHSSRF58-004 — integration event replay endpoint fetches user-supplied replayTargetUrl and stores raw response as replay confirmation — attacker points to etcd:2379; etcd configuration data stored as replay confirmation readable via integration history API; fix: allowlist; return only boolean replayed; never store raw response body

SSRF58-001 — IAM credential exfiltration via integration webhook delivery URL

Severity: CRITICAL

The integration webhook dispatch endpoint accepts a webhookDeliveryUrl parameter from the user and issues a server-side HTTP POST to that URL with the webhook payload. No URL validation is performed before the fetch. An attacker sets webhookDeliveryUrl to the AWS IMDSv1 endpoint http://169.254.169.254/latest/meta-data/iam/security-credentials/. The registry server fetches that URL from within the cloud VPC, receives the IAM role name in the response, issues a second fetch for the full credentials object, and returns the entire response body as the "webhook delivery confirmation" to the caller. The caller receives the IAM access key ID, secret access key, and session token — credentials that grant the same AWS permissions as the registry service role.

Never return raw fetch response bodies to callers. Even with URL allowlist validation, the response body from a webhook delivery URL should never be proxied back to the requesting user. The caller only needs to know whether delivery succeeded — return a boolean status and discard the response body.

Vulnerable
// POST /api/integrations/:id/webhook/deliver — no URL validation
router.post('/:id/webhook/deliver', requireSession, async (req, res) => {
  const { webhookDeliveryUrl, payload } = req.body;
  // attacker sets webhookDeliveryUrl to 169.254.169.254
  const result = await fetch(webhookDeliveryUrl, {
    method: 'POST',
    body: JSON.stringify(payload),
  });
  const body = await result.text();  // IAM credentials in body
  return res.json({ status: result.status, body });  // returned to attacker
});
Fixed
// POST /api/integrations/:id/webhook/deliver — URL allowlist + private-IP block
import { isPrivateIP } from './utils/ip-check.js';

const WebhookDeliverySchema = z.object({
  webhookDeliveryUrl: z.string().url().refine(
    url => {
      const { hostname } = new URL(url);
      return !isPrivateIP(hostname) && !hostname.includes('169.254') && !hostname.includes('localhost');
    },
    { message: 'Private or loopback URLs are not allowed' }
  ),
  payload: z.record(z.unknown()).optional(),
});

router.post('/:id/webhook/deliver', requireSession, async (req, res) => {
  const parsed = WebhookDeliverySchema.safeParse(req.body);
  if (!parsed.success) return res.status(400).json({ error: 'Invalid delivery URL' });

  const result = await fetch(parsed.data.webhookDeliveryUrl, {
    method: 'POST',
    redirect: 'error',  // reject redirects that could bypass IP check
    body: JSON.stringify(parsed.data.payload ?? {}),
    signal: AbortSignal.timeout(5000),
  });

  // Never proxy response body — return only delivery status
  return res.json({ delivered: result.ok, httpStatus: result.status });
});

SSRF58-002 — Consul topology leak via callback confirmation URL

Severity: CRITICAL

The callback confirmation endpoint fetches a user-supplied callbackConfirmationUrl to verify that the integration received a callback. The endpoint proxies the entire raw response body back to the caller as the "confirmation response." An attacker sets callbackConfirmationUrl to http://consul:8500/v1/catalog/services. The registry server fetches the Consul API and receives a JSON object containing the full internal service catalog — service names, their registered addresses and ports, and health check metadata. This topology data enables the attacker to enumerate the registry's internal service mesh and identify targets for subsequent SSRF or lateral movement attempts.

Vulnerable
// GET /api/integrations/:id/callback/confirm — proxies raw response body
router.get('/:id/callback/confirm', requireSession, async (req, res) => {
  const { callbackConfirmationUrl } = req.query;
  const result = await fetch(callbackConfirmationUrl);
  const body = await result.json();  // Consul catalog returned directly
  return res.json(body);  // full topology leak
});
Fixed
// GET /api/integrations/:id/callback/confirm — allowlist + boolean only
const ConfirmationSchema = z.object({
  callbackConfirmationUrl: z.string().url().refine(
    url => WEBHOOK_DOMAIN_ALLOWLIST.some(d => new URL(url).hostname.endsWith(d)),
    { message: 'URL not in allowlist' }
  ),
});

router.get('/:id/callback/confirm', requireSession, async (req, res) => {
  const parsed = ConfirmationSchema.safeParse(req.query);
  if (!parsed.success) return res.status(400).json({ error: 'Invalid confirmation URL' });

  const result = await fetch(parsed.data.callbackConfirmationUrl, {
    redirect: 'error',
    signal: AbortSignal.timeout(3000),
  });

  // Parse only the confirmed boolean from the response — discard all else
  const data = await result.json().catch(() => ({}));
  return res.json({ confirmed: Boolean(data?.confirmed) });
});

SSRF58-003 — Vault secret exfiltration via redirect-following integration health check URL

Severity: CRITICAL

The integration health check endpoint fetches a user-supplied healthCheckUrl using the default fetch() behavior with redirect:follow. An attacker registers a DNS name under their control that resolves to a public IP during the allowlist DNS resolution check, then uses a CNAME chain that ultimately resolves to the internal Vault service at http://vault:8200/v1/kv/data/registry-secrets. With redirect:follow, the fetch follows all redirects including those that change the destination to the internal Vault address. The Vault KV API returns the registry's secret bundle — API keys, database passwords, and service credentials — as the health check response body, which is returned to the attacker.

Vulnerable
// GET /api/integrations/:id/health — redirect:follow enables CNAME chain to Vault
router.get('/:id/health', requireSession, async (req, res) => {
  const { healthCheckUrl } = req.query;
  const result = await fetch(healthCheckUrl);  // redirect:follow by default
  const health = await result.json();          // Vault KV secrets in response
  return res.json({ healthy: result.ok, details: health });
});
Fixed
// GET /api/integrations/:id/health — redirect:error + allowlist + schema extraction only
const HealthCheckSchema = z.object({
  status: z.enum(['healthy', 'degraded', 'unhealthy']).optional(),
  version: z.string().optional(),
  latencyMs: z.number().optional(),
});

router.get('/:id/health', requireSession, async (req, res) => {
  const url = z.string().url().safeParse(req.query.healthCheckUrl);
  if (!url.success) return res.status(400).json({ error: 'Invalid health check URL' });

  if (!WEBHOOK_DOMAIN_ALLOWLIST.some(d => new URL(url.data).hostname.endsWith(d))) {
    return res.status(400).json({ error: 'Health check URL not in allowlist' });
  }

  const result = await fetch(url.data, {
    redirect: 'error',  // reject any redirect — prevents CNAME-chain bypass
    signal: AbortSignal.timeout(5000),
  });

  // Extract only structured health fields — discard all other response data
  const raw = await result.json().catch(() => ({}));
  const health = HealthCheckSchema.safeParse(raw);
  return res.json({ healthy: result.ok, ...(health.success ? health.data : {}) });
});

SSRF58-004 — etcd configuration exfiltration stored as event replay confirmation

Severity: HIGH

The integration event replay endpoint fetches a user-supplied replayTargetUrl to deliver replayed events and stores the raw response body as the replay confirmation record in the integration history database. An attacker sets replayTargetUrl to http://etcd:2379/v3/kv/range. The endpoint fetches the etcd KV range API, receives the full etcd configuration dataset containing registry service configuration keys, and stores this data as the replay confirmation. The stored data is then readable by any user with access to the integration history API — no second SSRF request is needed after the first. The confirmation record persists until the integration is deleted.

Vulnerable
// POST /api/integrations/:id/events/replay — stores raw response as confirmation
router.post('/:id/events/replay', requireSession, async (req, res) => {
  const { replayTargetUrl, eventIds } = req.body;
  const result = await fetch(replayTargetUrl, {
    method: 'POST',
    body: JSON.stringify({ events: eventIds }),
  });
  const confirmation = await result.text();  // etcd data
  // Store raw body — attacker reads it via /history API later
  await IntegrationHistory.create({ integrationId: req.params.id, confirmation });
  return res.json({ replayed: true, confirmation });
});
Fixed
// POST /api/integrations/:id/events/replay — allowlist + boolean only + no raw storage
const ReplaySchema = z.object({
  replayTargetUrl: z.string().url().refine(
    url => WEBHOOK_DOMAIN_ALLOWLIST.some(d => new URL(url).hostname.endsWith(d)),
    { message: 'Replay URL not in allowlist' }
  ),
  eventIds: z.array(z.string().uuid()).min(1).max(100),
});

router.post('/:id/events/replay', requireSession, async (req, res) => {
  const parsed = ReplaySchema.safeParse(req.body);
  if (!parsed.success) return res.status(400).json({ error: 'Invalid replay request' });

  const result = await fetch(parsed.data.replayTargetUrl, {
    method: 'POST',
    redirect: 'error',
    body: JSON.stringify({ events: parsed.data.eventIds }),
    signal: AbortSignal.timeout(10000),
  });

  // Store only delivery boolean — never store raw response body
  await IntegrationHistory.create({
    integrationId: req.params.id,
    replayed: result.ok,
    httpStatus: result.status,
    at: new Date(),
  });
  return res.json({ replayed: result.ok });
});

Related advisories:   SA-SKL-SSRF57 (notification delivery)  |  SA-SKL-SSRF56 (marketplace checkout)