Claude MCP skill SSRF — skill audit report generation and delivery endpoints — SA-SKL-SSRF52
SA-SKL-SSRF52 documents four server-side request forgery vulnerabilities in MCP skill registry audit report generation and delivery endpoints. These endpoints support user-supplied URLs at four distinct integration points: a logo URL for report branding, a delivery callback to confirm report receipt, an external resource URL for report link validation, and a scheduled delivery endpoint for recurring report dispatch. Each URL fetch occurs server-side with the full trust of the application network, allowing an attacker to pivot the server into the internal infrastructure and exfiltrate credentials, service catalog data, or secrets management content that is inaccessible from the public internet.
reportLogoUrl for report branding — attacker sets to 169.254.169.254; IAM credentials embedded as logo bytes in generated reportdeliveryCallbackUrl to confirm delivery — attacker points to Consul:8500; Consul catalog JSON returned as delivery confirmationresourceUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secrets as resource validation resultrecipientEndpointUrl for each scheduled audit — attacker points to etcd:2379; etcd configuration data stored as delivery confirmation readable via audit history APISSRF52-001 — IAM credential exfiltration via audit report logo URL
Severity: CRITICAL
The audit report generation endpoint accepts a user-supplied reportLogoUrl parameter that is fetched server-side to embed a custom logo in the generated PDF or HTML report. The fetch uses the application's default HTTP client configuration with no URL validation and redirect:follow. When an attacker sets reportLogoUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/, the server fetches the EC2 instance metadata endpoint and receives the IAM role name. A subsequent fetch to http://169.254.169.254/latest/meta-data/iam/security-credentials/{roleName} returns AccessKeyId, SecretAccessKey, and Token as the response body. This response is embedded as logo content in the generated report, which is then returned to the attacker as a downloadable artifact.
// reports/generate.js
const fetch = require('node-fetch');
async function generateAuditReport(options) {
// reportLogoUrl is user-supplied — no validation
const logoResponse = await fetch(options.reportLogoUrl);
const logoBytes = await logoResponse.buffer();
return buildReportPdf({ ...options, logoBytes });
}
// reports/generate.js
const fetch = require('node-fetch');
const dns = require('dns').promises;
const LOGO_ALLOWLIST = [
'assets.skillaudit.dev',
'raw.githubusercontent.com',
'avatars.githubusercontent.com',
];
const PRIVATE_IP_RANGES = [
/^10\./,
/^172\.(1[6-9]|2[0-9]|3[0-1])\./,
/^192\.168\./,
/^127\./,
/^169\.254\./,
/^::1$/,
/^fc00:/,
/^fe80:/,
];
async function validateLogoUrl(url) {
const parsed = new URL(url);
if (!LOGO_ALLOWLIST.includes(parsed.hostname)) {
throw new Error(`Logo URL hostname not in allowlist: ${parsed.hostname}`);
}
// DNS rebinding protection: resolve and check resolved IP
const { address } = await dns.lookup(parsed.hostname);
if (PRIVATE_IP_RANGES.some(r => r.test(address))) {
throw new Error(`Logo URL resolves to private IP: ${address}`);
}
return url;
}
async function generateAuditReport(options) {
const safeLogoUrl = await validateLogoUrl(options.reportLogoUrl);
// redirect:error prevents CNAME/redirect chains to private IPs
const logoResponse = await fetch(safeLogoUrl, { redirect: 'error' });
if (!logoResponse.ok) throw new Error('Logo fetch failed');
const logoBytes = await logoResponse.buffer();
return buildReportPdf({ ...options, logoBytes });
}
SSRF52-002 — Consul catalog exposure via delivery callback URL
Severity: CRITICAL
The audit report delivery endpoint fetches a user-supplied deliveryCallbackUrl after completing report delivery to confirm that the recipient system received the report. The fetch response body is stored directly as the delivery confirmation record and returned to the user via the delivery history API. When an attacker sets deliveryCallbackUrl to http://consul:8500/v1/catalog/services, the server fetches the internal Consul catalog endpoint, receives the JSON service registry (service names, addresses, ports, health checks, and metadata tags for all internal services), and stores this as the delivery confirmation body — which the attacker can then retrieve via the history API without further SSRF.
The fix restricts deliveryCallbackUrl to an allowlist of known delivery confirmation domains, parses only a boolean success/failure signal from the response body using Zod, and never stores or proxies the raw response body from the callback URL.
// reports/delivery.js
async function confirmDelivery(deliveryId, callbackUrl) {
const resp = await fetch(callbackUrl); // no URL validation
const body = await resp.text();
// raw response body stored as delivery confirmation — exfiltrates internal service data
await DeliveryRecord.updateOne({ _id: deliveryId }, { confirmation: body, confirmedAt: new Date() });
}
// reports/delivery.js
const { z } = require('zod');
const CALLBACK_ALLOWLIST = ['hooks.slack.com', 'api.pagerduty.com', 'notify.skillaudit.dev'];
const CallbackResponseSchema = z.object({ success: z.boolean() });
async function confirmDelivery(deliveryId, callbackUrl) {
const parsed = new URL(callbackUrl);
if (!CALLBACK_ALLOWLIST.includes(parsed.hostname)) {
throw new Error(`Callback URL not in allowlist: ${parsed.hostname}`);
}
const resp = await fetch(callbackUrl, { redirect: 'error' });
// Parse only the boolean success signal — never store raw response body
const { success } = CallbackResponseSchema.parse(await resp.json());
await DeliveryRecord.updateOne({ _id: deliveryId }, { confirmed: success, confirmedAt: new Date() });
}
SSRF52-003 — Vault KV secrets via CNAME redirect chain on resource validation
Severity: CRITICAL
The audit report external resource validation endpoint fetches user-supplied resourceUrl values using node-fetch with the default redirect:'follow' setting. An attacker can register an external domain with a CNAME record that resolves to vault.internal:8200. When the server fetches the attacker's domain, it follows the CNAME chain to Vault's HTTP API, retrieves KV secrets (database passwords, API tokens, signing keys), and returns the full response body as the resource validation result, surfaced to the attacker via the report's resource validation section.
The fix sets redirect:'error' to prevent CNAME and HTTP redirect chains, restricts resourceUrl to the same allowlist as logo URLs, extracts only the HTTP status code from the validation response (not the body), and rejects non-200 responses without proxying any body content.
SSRF52-004 — etcd configuration data via scheduled delivery recipient endpoint
Severity: HIGH
The audit report scheduled delivery system stores user-configured recipientEndpointUrl values and fetches each URL when a scheduled audit report is dispatched. The delivery worker stores the raw response body from each fetch as a delivery confirmation record, readable later via the audit history API. When an attacker sets recipientEndpointUrl to http://etcd:2379/v3/kv/range, the fetch returns etcd key-value configuration data (service discovery config, feature flags, infrastructure parameters) as the delivery body, which is persisted in the audit history and retrievable by the attacker without ongoing SSRF access.
The fix restricts recipientEndpointUrl to the callback allowlist at configuration time (before any scheduled delivery runs), returns only a boolean delivered signal and timestamp from scheduled delivery records, and never stores raw response bodies from webhook endpoints.
Remediation summary
| Finding | Severity | Primary remediation | Secondary hardening |
|---|---|---|---|
| SSRF52-001 | Critical | Allowlist logo URL domains; DNS private-IP block; redirect:error | Presigned S3 URL flow for pre-uploaded logos only |
| SSRF52-002 | Critical | Allowlist callback domains; Zod parse boolean only; never proxy raw body | redirect:error on callback fetch |
| SSRF52-003 | Critical | redirect:error; allowlist; extract only HTTP status code | Reject non-200 without body proxy; log rejected domains |
| SSRF52-004 | High | Allowlist at config time; return only boolean delivered + timestamp | Never persist raw webhook response bodies |
SkillAudit detects all four SA-SKL-SSRF52 patterns. The audit engine flags user-supplied URL fetch without allowlist validation, redirect:follow on external URL fetches, and raw response body storage from webhook endpoints. See related advisories: SA-SKL-SSRF51 and SA-SKL-SSRF50. Connect your repository at skillaudit.dev.