← Security advisories

Claude MCP skill SSRF — skill analytics and usage reporting dashboard endpoints — SA-SKL-SSRF67

SA-SKL-SSRF67 documents four SSRF vulnerabilities in MCP skill registry analytics and usage reporting dashboard endpoints. Analytics and reporting endpoints often accept user-supplied URLs for data export destinations, report data sources, dashboard sync origins, and observability sink health checks — each of which becomes an SSRF vector when the registry server fetches the URL from its own network context. SSRF67-001: analyticsExportUrl allows IMDS credential exfiltration from cloud provider metadata services; SSRF67-002: reportDataUrl allows internal service topology exposure via Consul API; SSRF67-003: syncUrl with redirect:follow allows CNAME-chain bypass to Vault KV secrets; SSRF67-004: sinkHealthUrl response storage allows persistent etcd data exfiltration via analytics history API.

SA-SKL-SSRF67 findings at a glance
CRITICALSSRF67-001 — analytics export endpoint fetches user-supplied analyticsExportUrl — attacker sets to 169.254.169.254/latest/meta-data/iam/security-credentials/; IAM credentials embedded in export confirmation response returned to caller; fix: allowlist; DNS private-IP block with PRIVATE_RANGES regex; redirect:error; return only HTTP status boolean
CRITICALSSRF67-002 — usage report endpoint fetches user-supplied reportDataUrl — attacker points to consul:8500/v1/catalog/services; full Consul catalog JSON returned as report data containing full internal service mesh topology; fix: allowlist; Zod parse only boolean fetched; never proxy raw response body
CRITICALSSRF67-003 — dashboard data sync endpoint fetches user-supplied syncUrl with redirect:follow — CNAME chain to vault:8200/v1/secret/data/registry returns KV secrets as sync confirmation; CNAME-based rebinding defeats allowlist controls checking only initial hostname; fix: redirect:error; allowlist; extract only structured sync schema
HIGHSSRF67-004 — analytics sink registration endpoint fetches user-supplied sinkHealthUrl and stores raw response as analytics sink record — attacker points to etcd:2379/v3/kv/range; etcd configuration data stored persistently as analytics record readable via analytics history API; fix: allowlist; return only boolean healthy; never store raw response body

SSRF67-001 — IMDS credential exfiltration via analytics export URL

Severity: CRITICAL

The analytics export endpoint accepts a user-supplied analyticsExportUrl parameter and fetches it from the registry server's network context to deliver the export payload. When an attacker sets this URL to the cloud provider Instance Metadata Service address at 169.254.169.254, the registry server requests its own IAM credentials from the IMDS endpoint. These credentials are then embedded in the export confirmation response returned directly to the attacker.

Cloud provider IAM credentials obtained via IMDS provide temporary but renewable access to the full permission scope attached to the registry server's cloud identity. In production deployments, this identity typically has access to the object storage bucket containing skill archives and audit logs, the managed database service hosting the registry's persistent data, the secret manager storing API signing keys and third-party integration credentials, and the container registry hosting registry server images. The attacker uses the exfiltrated credentials to enumerate and exfiltrate these resources independently of the registry API, with no audit trail connecting the data access to the original SSRF request.

Vulnerable
router.post('/analytics/export', requireSession, async (req, res) => {
  const { analyticsExportUrl, reportId } = req.body;
  const report = await AnalyticsReport.findById(reportId);
  if (!report) return res.status(404).json({ error: 'Report not found' });
  // Fetches from server network — vulnerable to IMDS, internal service access
  const exportResult = await fetch(analyticsExportUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(report.data),
  });
  const confirmation = await exportResult.json();
  return res.json({ exported: true, confirmation });  // returns IMDS response body to attacker
});
Fixed
const ANALYTICS_EXPORT_ALLOWLIST = (process.env.ANALYTICS_EXPORT_ALLOWLIST || '').split(',').filter(Boolean);
const PRIVATE_RANGES = /^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|127\.|169\.254\.|::1|fc00:|fd)/;
async function safeAnalyticsFetch(url) {
  const parsed = new URL(url);
  if (!ANALYTICS_EXPORT_ALLOWLIST.some(a => parsed.hostname === a)) throw new Error('Host not in allowlist');
  const resolved = await dns.promises.resolve4(parsed.hostname);
  if (resolved.some(ip => PRIVATE_RANGES.test(ip))) throw new Error('Resolved to private IP');
  const resp = await fetch(url, { redirect: 'error' });
  return resp.ok;
}
router.post('/analytics/export', requireSession, async (req, res) => {
  const { analyticsExportUrl, reportId } = req.body;
  const report = await AnalyticsReport.findById(reportId);
  if (!report) return res.status(404).json({ error: 'Report not found' });
  const ok = await safeAnalyticsFetch(analyticsExportUrl);
  return res.json({ exported: ok });  // boolean only — no response body proxied
});

The fix validates analyticsExportUrl against an explicit allowlist of permitted export destinations before fetching. DNS resolution is performed and checked against private IP ranges to block CNAME-based rebinding to IMDS or internal services. redirect: 'error' prevents redirect chains from bypassing the hostname check. Only a boolean exported status is returned to the caller — the response body from the external endpoint is never proxied back through the registry API.

SSRF67-002 — Consul catalog topology exposure via usage report data URL

Severity: CRITICAL

The usage reporting endpoint accepts a user-supplied reportDataUrl parameter and fetches it to retrieve external report data for aggregation into the dashboard. When an attacker sets this URL to the Consul HTTP API endpoint at consul:8500/v1/catalog/services, the registry server receives the full Consul service catalog listing every registered internal service by name, address, port, and tag set.

The Consul catalog response reveals the complete internal service mesh topology: every microservice component, its internal DNS name, its port bindings, its health check endpoints, and its deployment tags indicating environment and version. This topology information provides an attacker with a complete map for lateral movement — identifying the exact internal addresses and ports of the database cluster, the message broker, the secret manager, the internal admin API, and any other service registered in the mesh. The topology map is returned as the report data response body in the dashboard JSON, making it immediately readable without any additional requests.

Vulnerable
router.get('/analytics/usage-report', requireSession, async (req, res) => {
  const { reportDataUrl, period } = req.query;
  // Fetches from server network — vulnerable to Consul, Redis, internal APIs
  const externalData = await fetch(reportDataUrl).then(r => r.json());
  const report = await generateUsageReport(period, externalData);
  return res.json(report);
});
Fixed
const REPORT_DATA_ALLOWLIST = (process.env.REPORT_DATA_ALLOWLIST || '').split(',').filter(Boolean);
router.get('/analytics/usage-report', requireSession, async (req, res) => {
  const { reportDataUrl, period } = req.query;
  if (reportDataUrl) {
    const parsed = new URL(reportDataUrl);
    if (!REPORT_DATA_ALLOWLIST.some(a => parsed.hostname === a)) {
      return res.status(400).json({ error: 'reportDataUrl host not in allowlist' });
    }
    const resolved = await dns.promises.resolve4(parsed.hostname);
    if (resolved.some(ip => PRIVATE_RANGES.test(ip))) {
      return res.status(400).json({ error: 'reportDataUrl resolves to private IP' });
    }
    // Fetch and validate — only extract the boolean field we care about
    const resp = await fetch(reportDataUrl, { redirect: 'error' });
    const { dataReady } = z.object({ dataReady: z.boolean() }).parse(await resp.json());
    if (!dataReady) return res.json({ fetched: false });
  }
  const report = await generateUsageReport(period);
  return res.json(report);
});

The fix validates reportDataUrl against an allowlist of permitted data sources. Only the structured boolean field dataReady is extracted from the external response — the raw body is never proxied into the report output. The DNS private-IP check prevents CNAME-based rebinding attacks. The redirect: 'error' option prevents redirect chains that could bypass the initial hostname check.

SSRF67-003 — Vault KV secrets via CNAME-chain bypass on dashboard sync URL

Severity: CRITICAL

The dashboard data sync endpoint accepts a user-supplied syncUrl and fetches it with redirect: 'follow' to retrieve external data for dashboard synchronization. The redirect: 'follow' setting causes the registry server to follow HTTP 301/302 redirect responses, including CNAME-based DNS redirects that can point an initially-allowlisted hostname to an internal service address at lookup time. An attacker who controls a DNS record for a hostname on the allowlist can configure a CNAME chain that resolves through a series of attacker-controlled CNAMEs before terminating at vault.internal:8200, which the registry server contacts for the final response.

Vault's HTTP API at port 8200 returns KV secret data at paths like /v1/secret/data/registry without additional authentication when accessed from within the trusted network. The registry server occupies this trusted network position. The Vault response body containing registry signing keys, database credentials, third-party API tokens, and other KV secrets is returned as the sync confirmation response body to the attacker, who reads it from the dashboard sync confirmation. CNAME-based SSRF bypasses IP allowlists and hostname allowlists that check only the initial URL hostname without resolving the full redirect chain before fetching.

Vulnerable
router.post('/analytics/sync', requireSession, async (req, res) => {
  const { syncUrl } = req.body;
  // redirect: 'follow' allows CNAME chain to internal services
  const syncResult = await fetch(syncUrl, { redirect: 'follow' });
  const data = await syncResult.json();
  await updateDashboardData(req.session.userId, data);
  return res.json({ synced: true, timestamp: new Date() });
});
Fixed
const SyncConfirmationSchema = z.object({
  syncComplete: z.boolean(),
  itemCount: z.number().int().min(0).optional(),
});
const SYNC_ALLOWLIST = (process.env.SYNC_ALLOWLIST || '').split(',').filter(Boolean);
router.post('/analytics/sync', requireSession, async (req, res) => {
  const { syncUrl } = req.body;
  const parsed = new URL(syncUrl);
  if (!SYNC_ALLOWLIST.some(a => parsed.hostname === a)) {
    return res.status(400).json({ error: 'syncUrl host not in allowlist' });
  }
  const resolved = await dns.promises.resolve4(parsed.hostname);
  if (resolved.some(ip => PRIVATE_RANGES.test(ip))) {
    return res.status(400).json({ error: 'syncUrl resolves to private IP' });
  }
  // redirect: 'error' — refuse any redirect response rather than following redirect chains
  const syncResult = await fetch(syncUrl, { redirect: 'error' });
  const { syncComplete } = SyncConfirmationSchema.parse(await syncResult.json());
  if (syncComplete) await updateDashboardData(req.session.userId, {});
  return res.json({ synced: syncComplete, timestamp: new Date() });
});

The fix uses redirect: 'error' to refuse any redirect response, eliminating the CNAME-chain attack vector entirely. DNS resolution is performed before fetching to verify that the hostname resolves to a public IP, providing defense-in-depth against DNS rebinding even for direct connections. Only the structured syncComplete boolean is extracted from the external response body — the raw Vault response or any other internal service response body is never stored or returned.

SSRF67-004 — Persistent etcd data exfiltration via analytics sink health URL storage

Severity: HIGH

The analytics sink registration endpoint accepts a user-supplied sinkHealthUrl to verify that the analytics destination is reachable before registering it. The endpoint fetches the URL and stores the raw response body as the sink's health verification record in the analytics database. This stored response is subsequently readable via the analytics history API, which returns all historical health check responses for each registered sink.

An attacker who registers an analytics sink with a sinkHealthUrl pointing to etcd:2379/v3/kv/range causes the registry server to request etcd's key-value range API. The etcd response contains all keys and values in the etcd store — typically including cluster membership data, distributed lock state, service discovery configuration, and application configuration blobs that contain database connection strings, internal service credentials, and feature flag values. This response is stored as the sink's health record and remains readable via the analytics history API indefinitely, providing a persistent extraction channel that survives the original SSRF detection and remediation.

Vulnerable
router.post('/analytics/sinks', requireSession, async (req, res) => {
  const { sinkName, sinkHealthUrl, sinkType } = req.body;
  // Fetches from server network — vulnerable to etcd, Redis, internal APIs
  const healthResult = await fetch(sinkHealthUrl);
  const healthBody = await healthResult.text();
  const sink = await AnalyticsSink.create({
    userId: req.session.userId, sinkName, sinkType,
    sinkHealthUrl, healthRecord: healthBody,  // stores raw response — includes etcd data
    registeredAt: new Date(),
  });
  return res.status(201).json(sink);
});
Fixed
const SINK_ALLOWLIST = (process.env.SINK_HEALTH_ALLOWLIST || '').split(',').filter(Boolean);
router.post('/analytics/sinks', requireSession, async (req, res) => {
  const { sinkName, sinkHealthUrl, sinkType } = req.body;
  const parsed = new URL(sinkHealthUrl);
  if (!SINK_ALLOWLIST.some(a => parsed.hostname === a)) {
    return res.status(400).json({ error: 'sinkHealthUrl host not in allowlist' });
  }
  const resolved = await dns.promises.resolve4(parsed.hostname);
  if (resolved.some(ip => PRIVATE_RANGES.test(ip))) {
    return res.status(400).json({ error: 'sinkHealthUrl resolves to private IP' });
  }
  const healthResult = await fetch(sinkHealthUrl, { redirect: 'error' });
  const healthy = healthResult.ok;  // boolean only — raw body is never read or stored
  const sink = await AnalyticsSink.create({
    userId: req.session.userId, sinkName, sinkType,
    sinkHealthUrl, healthy, registeredAt: new Date(),
    // healthRecord field not stored — no raw response body persistence
  });
  return res.status(201).json({ sinkId: sink.id, healthy });
});

The fix validates sinkHealthUrl against an allowlist of permitted health check destinations and performs DNS resolution to block CNAME rebinding. The raw response body from the health check is never read or stored — only the HTTP response status code is used to determine healthy. The sink record stores only the boolean health status, eliminating the persistent exfiltration channel. Without the raw response body, the analytics history API cannot serve internal service data regardless of which URL was used for the health check.

Run SkillAudit to detect user-supplied URL fetch patterns in analytics export, report data, dashboard sync, and sink health endpoints in your MCP skill registry source code. Join the waitlist for access.