← Blog

SSRF in MCP Skill Registry Skill Audit Report Generation and Delivery Webhook Endpoints

SA-SKL-SSRF90 documents four SSRF vulnerabilities in the audit report generation and delivery webhook surface of MCP skill registries. The findings span IAM credential exfiltration via IMDS, internal service catalog disclosure, secrets management system bypass via CNAME chain, and persistent configuration poisoning via audit history storage.

SA-SKL-SSRF90 findings
CRITICALSSRF90-001 — Audit report delivery callback endpoint fetches user-supplied auditReportCallbackUrl; attacker sets URL to 169.254.169.254/latest/meta-data/iam/security-credentials/; IAM credentials in audit report callback response body forwarded to API caller
CRITICALSSRF90-002 — Audit findings export endpoint fetches user-supplied auditExportUrl; attacker points to Consul:8500/v1/catalog/services; full internal service catalog returned as audit export acknowledgment body accessible to the requesting user
CRITICALSSRF90-003 — Audit notification endpoint fetches user-supplied auditNotifyUrl with redirect:follow; CNAME chain from public domain to vault.internal bypasses assertSafeExternalUrl initial-hostname check; Vault:8200 KV secrets returned in notification acknowledgment body
HIGHSSRF90-004 — Audit import endpoint fetches user-supplied auditImportUrl and stores raw response body as audit record; attacker points to etcd:2379/v2/keys; full etcd configuration tree stored persistently and queryable via audit history API

SSRF90-001 — IAM credential exfiltration via audit delivery callback

The audit report delivery system supports a user-supplied callback URL (auditReportCallbackUrl) that the registry server fetches after generating an audit report, posting the report summary to the callback endpoint. The fetch is performed server-side without URL validation. An attacker who sets auditReportCallbackUrl to the AWS IMDS endpoint (http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE_NAME) causes the registry server to fetch IAM credentials from the instance metadata service. The response body — containing AccessKeyId, SecretAccessKey, and Token — is included in the audit callback acknowledgment returned to the API caller.

Vulnerable
// SSRF90-001 — VULNERABLE
// No URL validation — server fetches any user-supplied callback URL.

async function deliverAuditReport(auditId, callbackUrl, reportSummary) {
  // VULNERABLE: callbackUrl not validated — attacker sets to IMDS endpoint
  const ack = await fetch(callbackUrl, {
    method: 'POST',
    body: JSON.stringify({ auditId, summary: reportSummary }),
  });
  return { delivered: true, ackBody: await ack.text() };
  // ackBody contains IAM credentials when callbackUrl = 169.254.169.254
}

IAM credential theft via audit callback: Attacker submits {"auditReportCallbackUrl":"http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-role"}. Registry server fetches IMDS, receives {"AccessKeyId":"ASIA...","SecretAccessKey":"...","Token":"..."}. Credentials returned in delivery acknowledgment response body. Attacker uses credentials to access S3, DynamoDB, or any AWS service the registry-role IAM policy permits.

Fixed
// SSRF90-001 — FIXED
// Allowlist-based URL validation; block private IP ranges; no response body forwarding.

const { assertSafeExternalUrl } = require('../../lib/ssrf-guard');

async function deliverAuditReport(auditId, callbackUrl, reportSummary) {
  // FIXED: validate URL — rejects RFC1918, link-local, loopback, cloud metadata IPs
  assertSafeExternalUrl(callbackUrl);
  await fetch(callbackUrl, {
    method: 'POST',
    body: JSON.stringify({ auditId, summary: reportSummary }),
    redirect: 'manual',  // FIXED: no redirect following
  });
  // FIXED: ack body never forwarded to caller — only delivery status returned
  return { delivered: true };
}

SSRF90-002 — Consul service catalog disclosure via audit export URL

The audit findings export endpoint fetches a user-supplied auditExportUrl and returns the response as the export delivery acknowledgment. Consul runs on port 8500 on the internal network and is not exposed externally. An attacker who sets auditExportUrl to http://consul.internal:8500/v1/catalog/services causes the registry server to fetch the full Consul service catalog, which lists every microservice, its address, its port, and its health check URL. This internal service map enables targeted lateral movement across the internal network.

Vulnerable
// SSRF90-002 — VULNERABLE
async function exportAuditFindings(auditId, exportUrl) {
  // VULNERABLE: no URL validation — attacker sets to Consul:8500
  const response = await fetch(exportUrl);
  const ackBody = await response.text();  // full Consul service catalog returned
  return { exported: true, acknowledgment: ackBody };
}
Fixed
// SSRF90-002 — FIXED
async function exportAuditFindings(auditId, exportUrl) {
  assertSafeExternalUrl(exportUrl);  // rejects internal hostnames and RFC1918 IPs
  await fetch(exportUrl, { redirect: 'manual' });
  return { exported: true };  // no response body forwarded
}

SSRF90-003 — Vault KV secrets via CNAME chain bypass

The audit notification endpoint validates the supplied auditNotifyUrl using assertSafeExternalUrl(), which checks the initial hostname against a blocklist of known internal hostnames and private IP ranges. However, the fetch is performed with redirect: 'follow'. An attacker who controls a public domain can configure a CNAME chain: attacker-notify.com resolves to a CNAME pointing to vault-proxy.attacker.com, which resolves to the IP of the internal Vault server at port 8200. The initial hostname check passes (attacker-notify.com is a public domain), but the actual TCP connection lands on Vault:8200. The Vault KV store response is included in the notification acknowledgment body returned to the attacker.

Vulnerable
// SSRF90-003 — VULNERABLE
// assertSafeExternalUrl checks initial hostname but redirect:follow re-resolves CNAME chain.

async function sendAuditNotification(auditId, notifyUrl) {
  assertSafeExternalUrl(notifyUrl);  // passes for public hostname
  const resp = await fetch(notifyUrl, {
    method: 'POST',
    redirect: 'follow',  // VULNERABLE: follows CNAME chain to Vault:8200
    body: JSON.stringify({ auditId, status: 'complete' }),
  });
  return { notified: true, ackBody: await resp.text() };
  // ackBody = Vault KV secrets when CNAME resolves to vault.internal:8200
}
Fixed
// SSRF90-003 — FIXED
// Resolve DNS before fetch and validate resolved IP; never follow redirects.

const dns = require('dns/promises');
const { isPrivateIP } = require('../../lib/ssrf-guard');

async function sendAuditNotification(auditId, notifyUrl) {
  const url = new URL(notifyUrl);
  // FIXED: resolve DNS and check the resolved IP — CNAME chain fully resolved before validation
  const { address } = await dns.lookup(url.hostname);
  if (isPrivateIP(address)) throw Object.assign(new Error('SSRF blocked'), { status: 403 });
  await fetch(notifyUrl, {
    method: 'POST',
    redirect: 'manual',  // FIXED: no redirect following
    body: JSON.stringify({ auditId, status: 'complete' }),
  });
  return { notified: true };
}

SSRF90-004 — Persistent etcd config storage via audit import URL

The audit import endpoint fetches a user-supplied auditImportUrl and stores the raw response body as an audit record in the registry's audit history store. An attacker who sets auditImportUrl to http://etcd.internal:2379/v2/keys causes the full etcd configuration tree to be fetched and stored as an audit record. The etcd content — containing database connection strings, service credentials, and infrastructure configuration — is then persistently queryable via the audit history API by any authenticated user with read access to the audit log. Unlike other SSRF findings where the exfiltration is ephemeral, SSRF90-004 creates a persistent data exfiltration artifact that remains accessible after the initial attack.

Vulnerable
// SSRF90-004 — VULNERABLE
// Fetched response stored as audit record — persistent SSRF exfiltration artifact.

async function importAuditRecord(skillId, importUrl) {
  // VULNERABLE: no URL validation — attacker sets to etcd:2379
  const response = await fetch(importUrl);
  const content = await response.text();
  // VULNERABLE: raw response (etcd config tree) stored as audit record
  await db.auditHistory.create({ skillId, importedContent: content, importedAt: new Date() });
  return { imported: true, recordId: auditRecord.id };
}
Fixed
// SSRF90-004 — FIXED
async function importAuditRecord(skillId, importUrl) {
  // FIXED: validate URL — block internal networks
  assertSafeExternalUrl(importUrl);
  const response = await fetch(importUrl, {
    redirect: 'manual',
    headers: { 'User-Agent': 'SkillAudit-Import/1.0' },
  });
  const content = await response.text();
  // FIXED: validate content is valid JSON audit report structure before storing
  const parsed = parseAuditReportSchema(content);
  await db.auditHistory.create({ skillId, importedContent: JSON.stringify(parsed), importedAt: new Date() });
  return { imported: true };
}

Scan your MCP skill registry for SA-SKL-SSRF90

SkillAudit detects user-supplied URL fetch patterns, missing SSRF guards, and redirect-following configurations across all audit delivery, export, notification, and import endpoints.

Run a free audit