Claude MCP skill SSRF — skill analytics export and reporting endpoints — SA-SKL-SSRF59
SA-SKL-SSRF59 documents four server-side request forgery vulnerabilities in MCP skill registry skill analytics export and reporting endpoints. Analytics and reporting features are designed to deliver data to external destinations — export files delivered to customer-specified URLs, reports sent to configured webhooks, data source health checks verifying connectivity, and custom metric collectors pulling from user-defined endpoints. Each outbound HTTP call driven by user-supplied URLs is a potential SSRF vector. This advisory covers credential exfiltration via the cloud metadata API, internal network topology disclosure via Consul, Vault KV secret exposure through a CNAME redirect chain, and persistent etcd configuration leak via analytics record storage.
exportDeliveryUrl; attacker sets to 169.254.169.254; IAM credentials embedded in export delivery confirmation response returned to caller; fix: allowlist; DNS private-IP block; redirect:error; return only HTTP status booleanreportWebhookUrl; attacker points to Consul:8500; Consul catalog JSON returned as report delivery confirmation containing full internal network topology; fix: allowlist; Zod parse only boolean delivered; never proxy raw response bodydataSourceUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as data source verification result; fix: redirect:error; allowlist; extract only structured health schemametricsCollectorUrl and stores raw response as metrics record; attacker points to etcd:2379; etcd configuration data stored as metrics record readable via analytics history API; fix: allowlist; return only boolean collected; never store raw response bodySSRF59-001 — Export delivery URL fetches IAM credentials from cloud metadata API
Severity: CRITICAL
The analytics export endpoint accepts a user-supplied exportDeliveryUrl parameter specifying where to POST the export file. The endpoint fetches this URL using the server's HTTP client without validating that it resolves to a legitimate external destination. When the attacker sets exportDeliveryUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/, the server fetches the cloud instance metadata API and receives a JSON object listing the IAM role name. A second request to append the role name to the path returns a JSON document containing the AccessKeyId, SecretAccessKey, and Token for the instance role — temporary AWS credentials with the permissions of the registry's EC2 role. The export delivery confirmation response body, returned to the caller as confirmation of successful delivery, contains the credentials verbatim.
Instance metadata credentials are automatically rotated but immediately usable. The credentials returned by the metadata API are valid for the remaining duration of the rotation window — typically 30–60 minutes. Within that window, the attacker can use them to call any AWS API service accessible to the instance role, including S3, DynamoDB, and Secrets Manager.
// POST /api/analytics/export — SSRF via exportDeliveryUrl
router.post('/export', requireSession, async (req, res) => {
const { exportId, exportDeliveryUrl } = req.body;
const exportData = await Analytics.generateExport(exportId);
// fetches any URL including 169.254.169.254
const deliveryResp = await fetch(exportDeliveryUrl, {
method: 'POST',
body: JSON.stringify(exportData),
headers: { 'Content-Type': 'application/json' },
});
// proxies raw response body — returns IAM credentials to caller
const confirmation = await deliveryResp.json();
return res.json({ delivered: true, confirmation });
});
// POST /api/analytics/export — URL allowlist + DNS private-IP block + status-only response
const { URL } = require('url');
const dns = require('dns').promises;
async function isPrivateIp(hostname) {
const addrs = await dns.resolve4(hostname).catch(() => []);
return addrs.some(ip => /^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|127\.|169\.254\.)/.test(ip));
}
router.post('/export', requireSession, async (req, res) => {
const { exportId, exportDeliveryUrl } = req.body;
let parsed;
try { parsed = new URL(exportDeliveryUrl); } catch { return res.status(400).json({ error: 'Invalid URL' }); }
if (!['https:'].includes(parsed.protocol)) return res.status(400).json({ error: 'HTTPS only' });
if (await isPrivateIp(parsed.hostname)) return res.status(400).json({ error: 'Private addresses not allowed' });
const exportData = await Analytics.generateExport(exportId);
const deliveryResp = await fetch(exportDeliveryUrl, {
method: 'POST',
body: JSON.stringify(exportData),
headers: { 'Content-Type': 'application/json' },
redirect: 'error',
});
// return only HTTP status boolean — never proxy response body
return res.json({ delivered: deliveryResp.ok });
});
SSRF59-002 — Report webhook URL proxies Consul internal network topology
Severity: CRITICAL
The report delivery endpoint accepts a reportWebhookUrl and POSTs each generated report to that URL. When the attacker sets the URL to http://consul:8500/v1/catalog/services, the server queries the Consul service catalog and receives a JSON document listing every registered internal service by name. A follow-up report delivery request to http://consul:8500/v1/catalog/service/{name} for each discovered service returns service instances, their internal IP addresses, ports, health check endpoints, and metadata tags. The full internal service topology is returned to the attacker as the report delivery confirmation response. Organizations using Consul for service mesh or configuration management expose all service locations and health check URLs to any authenticated API user who can configure a report webhook.
// POST /api/analytics/reports/:id/deliver — SSRF via reportWebhookUrl
router.post('/:id/deliver', requireSession, async (req, res) => {
const report = await Report.findById(req.params.id);
const resp = await fetch(req.body.reportWebhookUrl, {
method: 'POST',
body: JSON.stringify(report),
headers: { 'Content-Type': 'application/json' },
});
// Consul catalog JSON proxied back as confirmation
const confirmation = await resp.json();
return res.json({ delivered: true, confirmation });
});
// POST /api/analytics/reports/:id/deliver — allowlist + status-only response
const ALLOWED_WEBHOOK_HOSTS = new Set(process.env.ALLOWED_WEBHOOK_HOSTS?.split(',') ?? []);
router.post('/:id/deliver', requireSession, async (req, res) => {
let parsed;
try { parsed = new URL(req.body.reportWebhookUrl); } catch { return res.status(400).json({ error: 'Invalid URL' }); }
if (!ALLOWED_WEBHOOK_HOSTS.has(parsed.hostname)) return res.status(400).json({ error: 'Host not in allowlist' });
const report = await Report.findById(req.params.id);
if (!report || String(report.ownerId) !== req.session.userId) return res.status(404).end();
const resp = await fetch(req.body.reportWebhookUrl, {
method: 'POST',
body: JSON.stringify({ reportId: report.id, generatedAt: report.generatedAt }),
headers: { 'Content-Type': 'application/json' },
redirect: 'error',
});
// never proxy response body — return boolean only
return res.json({ delivered: resp.ok });
});
SSRF59-003 — Data source verification URL follows CNAME chain to Vault returning KV secrets
Severity: CRITICAL
The analytics data source verification endpoint accepts a dataSourceUrl and fetches it with redirect: 'follow' (node-fetch and Got defaults) to confirm the data source is reachable. The attacker registers an external domain with a CNAME record pointing to vault.internal or the Vault pod's cluster DNS name. When the verification endpoint follows the CNAME chain, it reaches http://vault:8200/v1/secret/data/{path} and returns Vault KV version 2 secret data — including data.value fields — as the data source verification response body, which is returned to the caller as evidence that the data source is healthy. Database credentials, API keys, and service account tokens stored in Vault are exfiltrated through what appears to be a legitimate connectivity check.
// GET /api/analytics/datasources/verify — SSRF via dataSourceUrl with redirect follow
router.get('/verify', requireSession, async (req, res) => {
const { dataSourceUrl } = req.query;
// redirect:'follow' follows CNAME chains including to vault.internal
const resp = await fetch(dataSourceUrl, { method: 'GET', redirect: 'follow' });
const body = await resp.json();
return res.json({ reachable: resp.ok, healthData: body }); // Vault secrets proxied here
});
// GET /api/analytics/datasources/verify — redirect:error + allowlist + schema extraction
const DataSourceHealthSchema = z.object({
status: z.enum(['ok', 'degraded', 'down']),
latencyMs: z.number().nonneg().optional(),
version: z.string().optional(),
}).passthrough().transform(({ status, latencyMs, version }) => ({ status, latencyMs, version }));
router.get('/verify', requireSession, async (req, res) => {
let parsed;
try { parsed = new URL(req.query.dataSourceUrl); } catch { return res.status(400).json({ error: 'Invalid URL' }); }
if (!ALLOWED_WEBHOOK_HOSTS.has(parsed.hostname)) return res.status(400).json({ error: 'Host not in allowlist' });
const resp = await fetch(req.query.dataSourceUrl, {
method: 'GET',
redirect: 'error', // never follow redirects — CNAME chains blocked
signal: AbortSignal.timeout(5000),
});
if (!resp.ok) return res.json({ reachable: false });
const raw = await resp.json();
const health = DataSourceHealthSchema.safeParse(raw);
// return only validated structured fields — never raw response body
return res.json({ reachable: true, health: health.success ? health.data : {} });
});
SSRF59-004 — Custom metrics URL stores etcd configuration data as persistent analytics records
Severity: HIGH
The custom metrics endpoint accepts a metricsCollectorUrl, fetches metrics from that URL, and stores the raw response body as a metrics record associated with the authenticated user's analytics dashboard. When the attacker sets metricsCollectorUrl to http://etcd:2379/v3/kv/range with an appropriate POST body, the endpoint fetches the etcd KV range API, receives a Base64-encoded JSON response containing etcd key-value pairs — service configuration, feature flags, internal routing config — and stores it verbatim as a metrics record. The stored record is then readable via the standard analytics history API by any user with access to the dashboard. The attacker does not need to receive the data in real time; they store it in the registry's own analytics database and read it at leisure through the metrics history endpoint.
// POST /api/analytics/metrics/collect — SSRF via metricsCollectorUrl
router.post('/collect', requireSession, async (req, res) => {
const { metricsCollectorUrl, metricName } = req.body;
const resp = await fetch(metricsCollectorUrl);
const rawBody = await resp.text();
// stores etcd response as metrics record — readable via analytics history
await MetricsRecord.create({
userId: req.session.userId,
metricName,
value: rawBody, // raw etcd KV data stored here
collectedAt: new Date(),
});
return res.json({ collected: true });
});
// POST /api/analytics/metrics/collect — allowlist + never store raw body
const MetricsPayloadSchema = z.object({
value: z.number(),
unit: z.enum(['count', 'ms', 'bytes', 'percent']),
tags: z.record(z.string()).optional(),
});
router.post('/collect', requireSession, async (req, res) => {
let parsed;
try { parsed = new URL(req.body.metricsCollectorUrl); } catch { return res.status(400).json({ error: 'Invalid URL' }); }
if (!ALLOWED_WEBHOOK_HOSTS.has(parsed.hostname)) return res.status(400).json({ error: 'Host not in allowlist' });
const resp = await fetch(req.body.metricsCollectorUrl, { redirect: 'error', signal: AbortSignal.timeout(3000) });
if (!resp.ok) return res.json({ collected: false });
const raw = await resp.json();
const metrics = MetricsPayloadSchema.safeParse(raw);
if (!metrics.success) return res.json({ collected: false });
// store only validated structured fields — never raw response body
await MetricsRecord.create({
userId: req.session.userId,
metricName: req.body.metricName,
value: metrics.data.value,
unit: metrics.data.unit,
collectedAt: new Date(),
});
return res.json({ collected: true });
});