← Security advisories

Claude MCP skill SSRF — skill collaboration and co-editing session endpoints — SA-SKL-SSRF55

SA-SKL-SSRF55 documents four server-side request forgery vulnerabilities in MCP skill registry collaboration and co-editing session endpoints. Collaboration features introduce webhook callback URLs as a first-class concept — the system is expected to make outbound HTTP requests on behalf of users, making SSRF both natural to introduce and easily overlooked in review. The session join callback endpoint fetches a user-supplied URL to confirm participant arrival, allowing an attacker to route that request to the EC2 IMDS endpoint and receive IAM credentials in the confirmation response. The sync webhook endpoint proxies the raw response from an attacker-supplied URL back to the caller as a sync confirmation, enabling full Consul catalog enumeration. The presence callback follows redirects without restriction, allowing a CNAME chain to Vault that returns KV secrets inside the presence update body. And the session-end webhook stores its raw response as a collaboration history record, allowing etcd configuration data to persist in the history API indefinitely.

SA-SKL-SSRF55 findings at a glance
CRITICALSSRF55-001 — session join callback fetches sessionCallbackUrl without host validation; attacker sets to 169.254.169.254; IAM credentials embedded in join confirmation returned to caller; fix: allowlist; DNS private-IP block; redirect:error; return only HTTP status boolean
CRITICALSSRF55-002 — edit sync endpoint fetches syncWebhookUrl and proxies raw response as sync confirmation; attacker points to Consul:8500; full internal network topology returned; fix: allowlist; Zod parse only boolean synced; never proxy raw response body
CRITICALSSRF55-003 — presence endpoint fetches presenceCallbackUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as presence update confirmation; fix: redirect:error; allowlist; extract only structured presence schema
HIGHSSRF55-004 — session-end webhook fetches sessionEndCallbackUrl and stores raw response as collaboration history; attacker points to etcd:2379; etcd config readable via collaboration history API; fix: allowlist; return only boolean ended; never store raw response body

SSRF55-001 — Session join callback fetches IMDS, returning IAM credentials in confirmation response

Severity: CRITICAL

The collaboration session join endpoint accepts a sessionCallbackUrl parameter and fetches it to notify the participant's service that the join was confirmed. The URL is not validated against a host allowlist, and the fetch is performed without blocking RFC 1918 addresses or the IMDS link-local range. An attacker submitting sessionCallbackUrl: "http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-worker" causes the registry server to fetch its own IMDS endpoint and return the IAM role credential document — including AccessKeyId, SecretAccessKey, and Token — directly in the join confirmation response body.

The registry-worker IAM role has permissions scoped to the registry's operational needs: S3 read/write for skill artifact storage, Secrets Manager read for database credentials, and ECR pull for container images. An attacker with these credentials can exfiltrate all skill artifacts, read the registry's database connection string, and pull private container images — all without being on the registry's internal network. Because IMDS credentials rotate every few hours, the attacker has a narrow but renewable window to exploit the leaked tokens.

Vulnerable
// POST /api/collab/sessions/:id/join — fetches callback without host validation
router.post('/sessions/:id/join', requireSession, async (req, res) => {
  const { sessionCallbackUrl } = req.body;
  const session = await CollabSession.findById(req.params.id);
  if (!session) return res.status(404).json({ error: 'Not found' });

  // Fetch callback to confirm join — no URL validation
  const confirmation = await fetch(sessionCallbackUrl, { method: 'POST' });
  const body = await confirmation.json();

  await session.addParticipant(req.session.userId);
  return res.json({ joined: true, callbackConfirmation: body }); // leaks IMDS response
});
Fixed
// POST /api/collab/sessions/:id/join — allowlist + private-IP block + return boolean only
const CallbackUrlSchema = z.string().url().refine(
  (url) => isAllowedCallbackHost(url), // check against registered webhook hosts
  { message: 'Callback URL host not in allowed list' }
);

router.post('/sessions/:id/join', requireSession, async (req, res) => {
  const parsed = CallbackUrlSchema.safeParse(req.body.sessionCallbackUrl);
  if (!parsed.success) return res.status(400).json({ error: 'Invalid callback URL' });

  const session = await CollabSession.findById(req.params.id);
  if (!session) return res.status(404).json({ error: 'Not found' });

  // Fetch callback with redirect:error and private-IP DNS block
  let callbackOk = false;
  try {
    const r = await fetch(parsed.data, {
      method: 'POST',
      redirect: 'error',
      signal: AbortSignal.timeout(3000),
    });
    callbackOk = r.ok;
  } catch { callbackOk = false; }

  await session.addParticipant(req.session.userId);
  return res.json({ joined: true, callbackDelivered: callbackOk }); // never return body
});

SSRF55-002 — Edit sync webhook proxies raw Consul response as sync confirmation

Severity: CRITICAL

The collaborative edit sync endpoint fetches a user-supplied syncWebhookUrl after each incremental edit batch to push change notifications to the participant's integration. The raw HTTP response body from the fetched URL is included in the sync confirmation returned to the caller. An attacker pointing syncWebhookUrl to http://consul.service.internal:8500/v1/catalog/services causes the registry server to return the full Consul service catalog JSON — a comprehensive map of every internal service, its health status, its IP addresses, and its registered tags — directly in the sync confirmation body.

The Consul catalog is the foundation of the registry's internal service discovery. It reveals the hostnames and ports of the database primary, the Redis cluster, the secret store, the message broker, and all microservices. This topology information directly enables the construction of targeted follow-on attacks: the attacker can use the catalog to route subsequent SSRF probes to specific internal services rather than scanning a broad IP space, dramatically reducing the time to pivot from initial SSRF to database access or secrets exfiltration.

Never proxy webhook response bodies to the caller. Any endpoint that fetches a user-supplied URL and returns the response body to the user is an open SSRF data channel regardless of host validation. Even if host validation blocks known internal addresses, DNS rebinding, CNAME chains, and cloud provider metadata endpoints can bypass validation and reach internal services. Only return a structured boolean indicating whether the webhook delivery succeeded — never return the response body.

SSRF55-003 — Presence callback follows redirects to Vault, returning KV secrets in presence body

Severity: CRITICAL

The collaboration presence endpoint fetches a user-supplied presenceCallbackUrl with redirect: 'follow' (the default node-fetch behavior) to deliver presence update notifications. The response body from the final redirect destination is included in the presence update confirmation returned to the caller.

An attacker who controls a CNAME-chained redirect chain (attacker.com/presence → 301 to vault.service.internal:8200/v1/secret/data/registry/db-creds) causes the registry server to follow the chain and return the Vault KV secret document — including plaintext database credentials — as the presence update confirmation body. The redirect:follow behavior bypasses host allowlist checks that only validate the initial URL because the allowlist is not re-evaluated at each redirect hop. The fix disables redirect following entirely with redirect: 'error', and validates the initial URL against the allowlist before fetching.

SSRF55-004 — Session-end webhook stores etcd config response as collaboration history record

Severity: HIGH

The collaboration session end webhook endpoint fetches a user-supplied sessionEndCallbackUrl for each session close event and stores the raw response body as the endConfirmation field of the collaboration history record. This history record is subsequently readable by any participant in the session via the collaboration history API.

An attacker pointing sessionEndCallbackUrl to http://etcd.service.internal:2379/v3/kv/range causes the registry server to fetch the etcd key-value store's range endpoint and persist the full etcd configuration dump — which may include TLS certificates, cluster join tokens, and service configuration values — as a session history record. The stored data persists until the collaboration history is purged (typically 30–90 days), giving the attacker a persistent retrieval window via the legitimate history API endpoint. Unlike ephemeral SSRF responses, the stored body is accessible repeatedly without re-triggering the original SSRF, and the history API's access control is weaker than direct internal service access — any session participant can read it, not just the attacker who created the session.

Vulnerable
// POST /api/collab/sessions/:id/end — stores raw webhook response in history
router.post('/sessions/:id/end', requireSession, async (req, res) => {
  const { sessionEndCallbackUrl } = req.body;
  const session = await CollabSession.findById(req.params.id);

  let endConfirmation = null;
  if (sessionEndCallbackUrl) {
    const r = await fetch(sessionEndCallbackUrl, { method: 'POST' });
    endConfirmation = await r.text(); // stores raw response — may be etcd/Vault data
  }

  await CollabHistory.create({
    sessionId: req.params.id,
    endedAt: new Date(),
    endConfirmation, // persisted; readable via GET /api/collab/history/:sessionId
  });

  return res.status(204).end();
});
Fixed
// POST /api/collab/sessions/:id/end — allowlist + return boolean; never store body
router.post('/sessions/:id/end', requireSession, async (req, res) => {
  const session = await CollabSession.findById(req.params.id);
  if (!session) return res.status(404).json({ error: 'Not found' });

  let callbackDelivered = false;
  if (req.body.sessionEndCallbackUrl) {
    const parsed = CallbackUrlSchema.safeParse(req.body.sessionEndCallbackUrl);
    if (parsed.success) {
      try {
        const r = await fetch(parsed.data, {
          method: 'POST',
          redirect: 'error',
          signal: AbortSignal.timeout(3000),
        });
        callbackDelivered = r.ok;
      } catch { callbackDelivered = false; }
    }
  }

  await CollabHistory.create({
    sessionId: req.params.id,
    endedAt: new Date(),
    callbackDelivered, // boolean only — never store raw response body
  });

  return res.status(204).end();
});

Remediation summary

FindingSeverityPrimary remediationSecondary hardening
SSRF55-001CriticalAllowlist callback hosts; DNS private-IP block; redirect:error; return only HTTP status booleanAbort requests with AbortSignal.timeout(); log all SSRF-candidate URLs for retrospective analysis
SSRF55-002CriticalAllowlist webhook hosts; Zod parse only boolean synced; never proxy raw response bodyWebhook delivery queue with per-host rate limiting; audit log on webhook delivery attempts
SSRF55-003Criticalredirect:error; re-validate host allowlist at each redirect hop if follow is requiredAllowlist-only fetch helper as shared utility to prevent per-endpoint drift; test with SSRF probe suite on every deploy
SSRF55-004HighAllowlist hosts; return and store only boolean ended; never store raw webhook response bodiesTTL all collaboration history records; audit log on session-end webhook deliveries; purge history on participant removal

Find SSRF vulnerabilities like these before attackers do. SkillAudit scans your MCP skill registry collaboration endpoints for all four SA-SKL-SSRF55 patterns plus the broader SSRF advisory series. See the SA-SKL-DESER38 dependency deserialization advisory for related findings. Connect your repository at skillaudit.dev.