← Blog

SSRF in MCP Skill Registry Skill Compliance Certification and Security Attestation Webhook Endpoints

SA-SKL-SSRF91 documents four server-side request forgery vulnerabilities across the compliance certification and security attestation webhook surface of MCP skill registries. The findings span IMDS credential theft, Consul service catalog exfiltration, Vault secret access via CNAME chain redirect, and persistent etcd data exfiltration through compliance history storage.

SA-SKL-SSRF91 findings
CRITICALSSRF91-001 — compliance certification callback endpoint fetches user-supplied complianceCertCallbackUrl; attacker sets to 169.254.169.254/latest/meta-data/iam/security-credentials/; IAM credentials returned in certification callback response body
CRITICALSSRF91-002 — attestation export endpoint fetches user-supplied attestationExportUrl; attacker points to consul:8500/v1/catalog/services; full internal service catalog returned as attestation export acknowledgment body
CRITICALSSRF91-003 — attestation notification endpoint fetches user-supplied attestationNotifyUrl with redirect:follow; CNAME chain resolves to vault:8200/v1/secret/data/registry; Vault KV secrets included in notification acknowledgment
CRITICALSSRF91-004 — compliance import endpoint fetches user-supplied complianceImportUrl and stores raw response as compliance record; attacker points to etcd:2379/v3/keys; etcd config stored persistently and readable via public compliance history API

SSRF91-001 — IMDS credential theft via compliance certification callback URL

When a publisher initiates a compliance certification, the registry server fetches the publisher-supplied complianceCertCallbackUrl to deliver the certification result. No URL scheme, host, or RFC-1918 allowlist validation is applied before the fetch. An attacker submits complianceCertCallbackUrl: "http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-worker". The registry server fetches the IMDS endpoint, which returns a JSON document containing AccessKeyId, SecretAccessKey, and a session Token for the EC2 instance's attached IAM role. The certification response body — including the full IAM credential document — is returned to the attacker as the callback acknowledgment payload.

Vulnerable
// SSRF91-001 — VULNERABLE
const fetch = require('node-fetch');

router.post('/certifications/:certId/callback', requireSession, async (req, res) => {
  const cert = await db.complianceCerts.findByPk(req.params.certId);
  // VULNERABLE: no URL validation — attacker supplies internal endpoint
  const ackResponse = await fetch(cert.complianceCertCallbackUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ certId: cert.id, status: cert.status, grade: cert.grade }),
  });
  const ackBody = await ackResponse.text();
  // VULNERABLE: callback acknowledgment body (containing IAM creds) returned to attacker
  res.json({ acknowledged: true, ackPayload: ackBody });
});

IAM credential exfiltration with full response reflection: The IMDS credential document is returned verbatim in ackPayload. The leaked SecretAccessKey + Token pair provides temporary AWS API access with the registry worker's IAM role — typically including S3 artifact bucket read/write, ECR pull, and CloudWatch log read permissions.

Fixed
// SSRF91-001 — FIXED
const { validateWebhookUrl } = require('../../lib/ssrf-guard');

router.post('/certifications/:certId/callback', requireSession, async (req, res) => {
  const cert = await db.complianceCerts.findByPk(req.params.certId);
  // FIXED: validateWebhookUrl blocks RFC-1918, link-local, and localhost targets
  await validateWebhookUrl(cert.complianceCertCallbackUrl);
  const ackResponse = await fetch(cert.complianceCertCallbackUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ certId: cert.id, status: cert.status, grade: cert.grade }),
    redirect: 'error',  // FIXED: no redirect following
  });
  // FIXED: only return HTTP status code — never reflect response body to caller
  res.json({ acknowledged: ackResponse.ok });
});

SSRF91-002 — Consul service catalog exfiltration via attestation export URL

The attestation export endpoint fetches a user-supplied attestationExportUrl to deliver the signed attestation document to an external compliance system. No URL validation is performed. An attacker supplies attestationExportUrl: "http://consul:8500/v1/catalog/services". The registry server delivers the attestation payload to Consul's service catalog endpoint (which is unauthenticated on many default deployments). Consul returns the full list of registered services — including internal service names, ports, and health check addresses. This information is then returned to the attacker in the export acknowledgment body, mapping the entire internal service mesh topology.

Vulnerable
// SSRF91-002 — VULNERABLE
router.post('/attestations/:attId/export', requireSession, async (req, res) => {
  const att = await db.attestations.findByPk(req.params.attId);
  // VULNERABLE: attacker-controlled URL reaches internal Consul service catalog
  const exportResp = await fetch(att.attestationExportUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ attestationId: att.id, payload: att.signedPayload }),
  });
  const exportAck = await exportResp.json();
  // VULNERABLE: Consul JSON service list reflected as acknowledgment
  res.json({ exported: true, acknowledgment: exportAck });
});
Fixed
// SSRF91-002 — FIXED
router.post('/attestations/:attId/export', requireSession, async (req, res) => {
  const att = await db.attestations.findByPk(req.params.attId);
  await validateWebhookUrl(att.attestationExportUrl);  // blocks RFC-1918
  const exportResp = await fetch(att.attestationExportUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ attestationId: att.id, payload: att.signedPayload }),
    redirect: 'error',
  });
  // FIXED: never reflect response body — return only success status
  res.json({ exported: exportResp.ok });
});

SSRF91-003 — Vault secret access via CNAME chain SSRF on attestation notify URL

The attestation notification endpoint fetches attestationNotifyUrl with redirect: 'follow' to support notification services that use redirect-based delivery. An attacker registers a domain under their control with a CNAME record pointing to vault (or the internal DNS name of the Vault instance). When the registry server follows the redirect chain, the final request arrives at http://vault:8200/v1/secret/data/registry. Vault's default token-based access control, if misconfigured to allow unauthenticated reads on the secret/registry path, returns the full KV secret bundle — including database passwords, JWT signing keys, and Stripe API keys — in the notification acknowledgment response body.

Vulnerable
// SSRF91-003 — VULNERABLE
router.post('/attestations/:attId/notify', requireSession, async (req, res) => {
  const att = await db.attestations.findByPk(req.params.attId);
  const notifyResp = await fetch(att.attestationNotifyUrl, {
    method: 'POST',
    redirect: 'follow',   // VULNERABLE: follows CNAME chain to internal Vault endpoint
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ event: 'attestation.completed', attestationId: att.id }),
  });
  const notifyBody = await notifyResp.text();
  // VULNERABLE: Vault KV secrets in notifyBody returned to attacker
  res.json({ notified: true, response: notifyBody });
});
Fixed
// SSRF91-003 — FIXED
router.post('/attestations/:attId/notify', requireSession, async (req, res) => {
  const att = await db.attestations.findByPk(req.params.attId);
  // FIXED: DNS rebinding guard resolves final IP before fetch; blocks RFC-1918
  await validateWebhookUrl(att.attestationNotifyUrl, { resolveAndCheck: true });
  const notifyResp = await fetch(att.attestationNotifyUrl, {
    method: 'POST',
    redirect: 'error',    // FIXED: no redirect following
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ event: 'attestation.completed', attestationId: att.id }),
  });
  res.json({ notified: notifyResp.ok });
});

SSRF91-004 — Persistent etcd data exfiltration via compliance import storage

The compliance import endpoint fetches complianceImportUrl and stores the raw response body as the compliance record body in the database. The compliance record is then surfaced via the public compliance history API. An attacker submits complianceImportUrl: "http://etcd:2379/v3/keys". The registry server fetches the etcd key listing, which returns the full etcd keyspace — including stored secrets, configuration blobs, and service discovery records. The raw etcd response is stored as the compliance record body and immediately becomes readable by any user calling the public GET /api/skills/:id/compliance/history endpoint, persisting the internal infrastructure data indefinitely.

Vulnerable
// SSRF91-004 — VULNERABLE
router.post('/compliance/import', requireSession, async (req, res) => {
  // VULNERABLE: no URL validation — attacker points to etcd
  const importResp = await fetch(req.body.complianceImportUrl);
  const importBody = await importResp.text();
  // VULNERABLE: raw etcd response body stored as compliance record — public via history API
  const record = await db.complianceRecords.create({
    skillId: req.body.skillId,
    source: req.body.complianceImportUrl,
    body: importBody,   // contains full etcd keyspace
    importedAt: new Date(),
  });
  res.status(201).json({ id: record.id });
});

Persistent SSRF with public exfiltration path: Unlike SSRF variants where response data is returned only to the attacker, this variant stores the internal data in a public compliance history record. Any user with GET access to the compliance history endpoint can read the etcd keyspace indefinitely after the import — no ongoing attacker interaction required.

Fixed
// SSRF91-004 — FIXED
router.post('/compliance/import', requireSession, async (req, res) => {
  await validateWebhookUrl(req.body.complianceImportUrl);  // blocks internal targets
  const importResp = await fetch(req.body.complianceImportUrl, { redirect: 'error' });
  const importBody = await importResp.text();
  // FIXED: validate body is a known compliance document schema before storing
  const parsed = parseComplianceDocument(importBody);  // throws on unexpected shape
  const record = await db.complianceRecords.create({
    skillId: req.body.skillId,
    source: req.body.complianceImportUrl,
    // FIXED: store parsed/validated fields only — never raw response body
    standard: parsed.standard,
    grade: parsed.grade,
    issuedAt: parsed.issuedAt,
    importedAt: new Date(),
  });
  res.status(201).json({ id: record.id });
});

Scan your MCP skill registry for SA-SKL-SSRF91

SkillAudit detects unvalidated webhook URL patterns in compliance and attestation endpoints, IMDS reachability, redirect-follow CNAME chains, and persistent SSRF storage vulnerabilities in under 60 seconds.

Run a free audit