Claude MCP skill SSRF — skill audit report export and delivery endpoints — SA-SKL-SSRF49
SA-SKL-SSRF49 documents four server-side request forgery vulnerabilities in MCP skill registry audit report export and delivery endpoints. Audit report export pipelines are rich SSRF targets because they legitimately fetch external resources — branding assets, linked documentation URLs, delivery confirmation hooks — during report generation and scheduled delivery. SSRF49-001 exploits the PDF export endpoint's logoUrl parameter to embed IAM credentials from the metadata service as logo bytes in the exported PDF. SSRF49-002 exploits the delivery confirmation webhook to proxy Consul's service catalog through the response body. SSRF49-003 uses a CNAME redirect chain to bypass a hostname allowlist on the link validation endpoint and reach Vault's KV API. SSRF49-004 exploits scheduled delivery's recipient webhook URL to store etcd cluster data in the audit history database, where it remains readable to any authenticated user via the history API. Each pattern converts a legitimately-networked audit service into an exfiltration vector for internal infrastructure secrets.
logoUrl for report branding; attacker sets to 169.254.169.254; IAM credentials embedded as logo bytes in exported PDFdeliveryWebhookUrl to confirm receipt; attacker points to Consul:8500; Consul catalog JSON returned as delivery confirmation bodylinkUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as link validation resultrecipientWebhookUrl for each scheduled report; attacker points to etcd:2379; etcd cluster data stored as delivery confirmation readable via audit history APISSRF49-001 — IAM credential exfiltration via PDF export logo URL
The audit report PDF export endpoint accepts a logoUrl parameter that specifies a custom branding image to embed in the exported PDF. The export worker fetches this URL server-side and embeds the retrieved bytes as the logo image in the PDF. When logoUrl is set to http://169.254.169.254/latest/meta-data/iam/security-credentials/, the IMDS endpoint on AWS returns the IAM role name. A second request to the role-specific URL returns a JSON document containing AccessKeyId, SecretAccessKey, and Token. These bytes are embedded as the logo image in the exported PDF, and the attacker retrieves the credentials by downloading the exported PDF and extracting the logo bytes.
The PDF delivery mechanism makes this attack particularly effective. The exported PDF is delivered directly to the requesting user, containing the IAM credentials in a machine-readable format embedded within the PDF's image data stream. The attack leaves no anomalous entries in the registry's application logs — the PDF export is a legitimate operation and the logo fetch is an expected sub-request. Detection requires inspecting either the outbound network requests from the export worker (at the infrastructure level) or the content of exported PDFs for unexpected image data patterns.
SSRF49-001 fix: Replace free-form logoUrl with a pre-upload flow: users upload their logo to the registry's own storage via a presigned S3 URL, then reference the resulting asset key in the PDF export request. The export worker fetches only from assets.skillaudit.dev (the registry's own CDN) using an internal S3 path. If a URL fetch is unavoidable, enforce an allowlist of approved CDN hostnames, block all private IP ranges via DNS resolution check before the fetch, set redirect: 'error', and reject any response whose Content-Type is not an image type.
router.post('/reports/:id/export/pdf',
requireSession,
async (req, res) => {
const { logoUrl } = req.body;
const logoBytes = await fetch(logoUrl).then(r => r.arrayBuffer());
// logoUrl can be http://169.254.169.254/... → IAM creds in PDF
const pdf = await generatePdf({ logoBytes, reportId: req.params.id });
res.send(pdf);
}
);
router.post('/reports/:id/export/pdf',
requireSession,
async (req, res) => {
const { logoAssetKey } = req.body;
// validate key belongs to requesting org's asset bucket
const assetPath = await db.getOrgAssetPath(req.session.orgId, logoAssetKey);
if (!assetPath) return res.status(400).json({ error: 'invalid_asset_key' });
// fetch only from internal S3 — never from user-supplied URL
const logoBytes = await s3.getObject({ Bucket: 'skillaudit-assets', Key: assetPath });
const pdf = await generatePdf({ logoBytes, reportId: req.params.id });
res.send(pdf);
}
);
SSRF49-002 — Consul catalog exfiltration via delivery webhook confirmation
The audit report delivery endpoint fetches the user-supplied deliveryWebhookUrl after sending a report to confirm that the recipient's webhook handler processed the delivery successfully. The confirmation fetch sends a small probe request and stores the response body as the delivery status record. When deliveryWebhookUrl is pointed at http://consul.service.consul:8500/v1/catalog/services, the Consul HTTP API returns a JSON object listing all registered services and their associated tags. This catalog JSON is stored verbatim as the delivery confirmation body in the registry's delivery history database.
The persisted delivery confirmation is subsequently readable by any authenticated member of the org that submitted the delivery — through the delivery history API. This exfiltration vector does not require the attacker to control the initial HTTP response timing; they simply check the delivery history after a brief delay and retrieve the full Consul service catalog from the confirmation body. The attack is repeatable on a schedule by submitting new delivery requests at regular intervals, maintaining a continuously-updated copy of the internal service catalog.
SSRF49-002 fix: Enforce an allowlist of approved delivery confirmation domains. Apply a Zod schema to the confirmation response that accepts only a boolean success field and an optional string message — never store or return the raw response body. Set a 2KB size limit on confirmation responses. Add DNS resolution validation before every fetch to block private IP ranges, link-local addresses, and localhost.
SSRF49-003 — Vault KV secret exfiltration via link validation CNAME redirect bypass
The audit report external link validation endpoint fetches user-supplied linkUrl values to verify that referenced documentation and resource links in audit reports are reachable. The endpoint sets redirect: 'follow' to handle standard URL redirections, and validates only the initial hostname against an allowlist. An attacker registers a CNAME record for an attacker-controlled domain that resolves to vault.service.consul: docs.attacker.com CNAME vault.service.consul. The initial hostname check passes (docs.attacker.com is not on a blocklist), but the redirect — which follows the CNAME at the DNS level — delivers the fetch to Vault's HTTP API. With Vault running in development mode or with a misconfigured token policy, the response includes KV secrets from Vault's secret store, returned as the link validation result.
CNAME-based allowlist bypass is a well-documented SSRF technique that defeats hostname-only validation. The fix requires validating the resolved IP address of the destination host — after all CNAME hops — against a private IP blocklist, not just the input hostname. Setting redirect: 'error' prevents the CNAME chain from being followed at the fetch level, eliminating the redirect-based bypass entirely.
SSRF49-003 fix: Set redirect: 'error' on all fetch calls in the link validation endpoint. Resolve the destination hostname to its final IP address before the fetch and reject any IP in RFC1918, link-local (169.254.0.0/16), loopback, or other non-public ranges. Enforce an allowlist of approved documentation hosting domains. Extract only the HTTP status code from the validation response — never return or store the response body.
SSRF49-004 — etcd cluster data persistence via scheduled delivery recipient webhook
The scheduled audit report delivery endpoint fires a webhook to each configured recipientWebhookUrl for every scheduled report delivery cycle. After delivery, it stores a summary of the delivery attempt — including the response status and a truncated response body — in the audit history database as a delivery confirmation record. When recipientWebhookUrl is pointed at http://etcd.service.consul:2379/v3/kv/range, the etcd v3 HTTP API returns a JSON payload containing key-value pairs from etcd's cluster state store, including service configuration values, feature flags, and potentially database connection strings stored as etcd configuration entries.
The persisted delivery confirmation record is accessible to any authenticated member of the org via the audit history API. Because scheduled delivery fires on a recurring schedule for all reports with active delivery subscriptions, the exfiltration is continuous: each delivery cycle stores a fresh snapshot of the etcd response in the history database, with the most recent delivery confirmation always reflecting the current etcd cluster state. The attacker retrieves the data through the legitimate audit history endpoint with no anomalous access patterns visible at the application layer.
SSRF49-004 fix: Enforce an allowlist of approved webhook delivery domains. Validate the destination IP against a private IP blocklist after DNS resolution. Store only a boolean delivered and the HTTP status code — never the raw response body. Apply a strict 1KB response body size limit. For scheduled delivery, require webhook URL ownership verification (a challenge-response handshake to the target URL) before the URL is accepted as a delivery recipient.
async function sendScheduledDelivery(report, recipientWebhookUrl) {
const resp = await fetch(recipientWebhookUrl, {
method: 'POST',
body: JSON.stringify(report)
});
const confirmation = await resp.text(); // stores etcd JSON verbatim
await db.saveDeliveryConfirmation(report.id, confirmation);
}
const WEBHOOK_ALLOWLIST = new Set(['hooks.slack.com', 'api.pagerduty.com']);
async function sendScheduledDelivery(report, recipientWebhookUrl) {
const url = new URL(recipientWebhookUrl);
if (!WEBHOOK_ALLOWLIST.has(url.hostname)) throw new Error('domain not in allowlist');
const resolved = await dns.resolve4(url.hostname);
if (resolved.some(isPrivateIp)) throw new Error('private IP rejected');
const resp = await fetch(recipientWebhookUrl, {
method: 'POST',
body: JSON.stringify(report),
redirect: 'error'
});
// store only boolean + status — never raw body
await db.saveDeliveryConfirmation(report.id, {
delivered: resp.ok,
status: resp.status
});
}
SkillAudit scans your registry's audit report export and delivery infrastructure for all four SSRF49 patterns, plus the full SA-SKL-SSRF series covering server-side request forgery in every registry subsystem. Get started free — 3 audits/month on public repos, results in 60 seconds.