Claude MCP skill SSRF — skill review and audit submission webhook endpoints (SA-SKL-SSRF84)
SA-SKL-SSRF84 identifies four Server-Side Request Forgery vulnerabilities across MCP skill registry skill review and audit submission webhook endpoints. The audit submission callback endpoint fetches a user-supplied URL without validation, allowing an attacker to target the EC2 instance metadata service and retrieve live IAM credentials that grant cloud control plane access; the review completion webhook endpoint fetches a user-supplied URL and returns its full response body, allowing an attacker to exfiltrate the complete Consul service catalog and map every internal microservice; the audit result delivery endpoint follows HTTP redirects including DNS-based CNAME chains that resolve to internal services like Vault, returning KV secrets directly in the response; and the review export endpoint fetches a user-supplied URL, stores the raw response body as a persistent review record, and surfaces it through the review history API, allowing an attacker to pivot raw etcd configuration data into a queryable, long-lived exfiltration artifact.
auditCallbackUrl — attacker sets to 169.254.169.254; IAM credentials in audit submission callback response bodyreviewWebhookUrl — attacker points to Consul:8500; full service catalog as review completion webhook bodyauditResultUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secretsreviewExportUrl and stores raw response as review record — attacker points to etcd:2379; etcd config stored persistently via review history APISSRF84-001 — Audit callback URL fetches instance metadata service and leaks IAM credentials
The audit submission pipeline accepts an auditCallbackUrl field that the registry server fetches after audit completion to notify the submitter. No URL validation is performed before the fetch. An attacker submits an audit with auditCallbackUrl set to http://169.254.169.254/latest/meta-data/iam/security-credentials/; the registry server fetches this URL from its cloud instance context, retrieves the name of the attached IAM role, makes a second fetch to that role's credential URL, and returns the live AccessKeyId, SecretAccessKey, and SessionToken in the callback response body which the attacker reads from the audit result. These credentials grant cloud control plane access until they rotate.
// SSRF84-001 — VULNERABLE: unvalidated auditCallbackUrl fetched server-side
router.post('/audits/submit', requireSession, async (req, res) => {
const { skillId, auditCallbackUrl } = req.body;
const audit = await auditService.create({ skillId, submittedBy: req.session.userId });
// Fires after audit completes — attacker sets auditCallbackUrl to 169.254.169.254
audit.on('complete', async (result) => {
const response = await fetch(auditCallbackUrl, {
method: 'POST',
body: JSON.stringify(result)
});
// response body contains IAM credentials
});
res.json({ auditId: audit.id });
});
// SSRF84-001 — FIXED: assertSafeExternalUrl(); redirect:error; return only statusCode
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
router.post('/audits/submit', requireSession, async (req, res) => {
const { skillId, auditCallbackUrl } = req.body;
// Validate URL before storing — rejects private IP ranges, metadata endpoints
assertSafeExternalUrl(auditCallbackUrl);
const audit = await auditService.create({
skillId,
submittedBy: req.session.userId,
callbackUrl: auditCallbackUrl
});
audit.on('complete', async (result) => {
const response = await fetch(audit.callbackUrl, {
method: 'POST',
redirect: 'error', // block redirects to internal hosts
body: JSON.stringify({ auditId: audit.id, status: result.status }),
signal: AbortSignal.timeout(5000)
});
// Store only statusCode — never response body
await auditService.recordCallbackDelivery(audit.id, { statusCode: response.status });
});
res.json({ auditId: audit.id });
});
Instance metadata at 169.254.169.254 is reachable from every cloud workload by default. IMDSv2 adds a PUT-preflight requirement that blocks simple GET requests, but many registries still run on IMDSv1-enabled instances. Use assertSafeExternalUrl() to block all link-local, private RFC 1918, and loopback addresses before any server-side fetch of user-supplied URLs.
SSRF84-002 — Review webhook URL reaches Consul and returns full service catalog
The review completion pipeline sends a webhook notification to a reviewWebhookUrl field supplied at review creation time. The webhook fetch is performed server-side and the full HTTP response body from the target URL is logged for debugging. An attacker creates a review with reviewWebhookUrl set to http://consul:8500/v1/catalog/services; when the review completes, the registry server fetches that URL using internal DNS resolution, Consul responds with a JSON document listing every registered service name and their datacenter assignments, and the attacker reads the full service catalog from the debug log or by polling the review status endpoint which surfaces the last webhook delivery attempt details.
// SSRF84-002 — VULNERABLE: reviewWebhookUrl fetched without validation; body logged
router.post('/reviews/create', requireSession, async (req, res) => {
const { skillId, reviewWebhookUrl } = req.body;
const review = await reviewService.create({ skillId, webhookUrl: reviewWebhookUrl });
review.on('complete', async (outcome) => {
// attacker points to consul:8500 — full service catalog returned
const response = await fetch(review.webhookUrl, {
method: 'POST',
body: JSON.stringify(outcome)
});
const responseBody = await response.text();
// service catalog stored in debug log and surfaced via review status endpoint
logger.debug('webhook delivery', { reviewId: review.id, responseBody });
});
res.json({ reviewId: review.id });
});
// SSRF84-002 — FIXED: assertSafeExternalUrl(); HEAD-only; return only statusCode
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
router.post('/reviews/create', requireSession, async (req, res) => {
const { skillId, reviewWebhookUrl } = req.body;
assertSafeExternalUrl(reviewWebhookUrl);
const review = await reviewService.create({ skillId, webhookUrl: reviewWebhookUrl });
review.on('complete', async () => {
// HEAD request — no response body, confirms endpoint reachability only
const response = await fetch(review.webhookUrl, {
method: 'HEAD',
redirect: 'error',
signal: AbortSignal.timeout(5000)
});
// Store only statusCode — never response body
await reviewService.recordWebhookDelivery(review.id, { statusCode: response.status });
});
res.json({ reviewId: review.id });
});
Webhook endpoints only need to know the delivery succeeded, not what the target returned. Sending a HEAD request and recording only the HTTP status code eliminates the SSRF data exfiltration channel entirely while still providing the delivery confirmation signal the webhook recipient needs. If the recipient requires a payload, send a signed notification body but never read or store the response body.
SSRF84-003 — Audit result delivery follows CNAME chain to Vault and returns KV secrets
The audit result delivery endpoint accepts a user-supplied auditResultUrl and delivers the audit outcome to that URL using fetch() with redirect: 'follow'. An attacker registers a DNS CNAME record for a domain they control that chains to vault.internal:8200 and submits this domain as the auditResultUrl. When the registry server resolves the CNAME chain during the fetch, DNS returns the internal Vault address; the fetch bypasses the initial hostname check because the CNAME resolution happens after URL validation. Vault responds to the authenticated internal request with KV secrets including database credentials and API keys, which are returned in the HTTP response body that the attacker reads from the audit result delivery confirmation.
// SSRF84-003 — VULNERABLE: redirect:follow allows CNAME chain to bypass host check
const { isPrivateIp } = require('is-private-ip');
const { URL } = require('url');
router.post('/audits/:id/deliver', requireSession, async (req, res) => {
const { auditResultUrl } = req.body;
const parsed = new URL(auditResultUrl);
// Only checks the hostname in the submitted URL — CNAME resolves AFTER this check
if (isPrivateIp(parsed.hostname)) return res.status(400).json({ error: 'private IP' });
// redirect:follow follows CNAME chain to vault:8200
const response = await fetch(auditResultUrl, {
method: 'POST',
redirect: 'follow',
body: JSON.stringify(await auditService.getResult(req.params.id))
});
const body = await response.text(); // contains Vault KV secrets
res.json({ delivered: true, statusCode: response.status });
});
// SSRF84-003 — FIXED: assertSafeExternalUrl() with DNS pre-resolution check; redirect:error
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
// ssrf-guard resolves DNS before the fetch and re-validates the resolved IP
// rejects RFC 1918, link-local, loopback, and 169.254/16
router.post('/audits/:id/deliver', requireSession, async (req, res) => {
const { auditResultUrl } = req.body;
// DNS pre-resolution check: resolves CNAME chain, validates final IP
await assertSafeExternalUrl(auditResultUrl);
const response = await fetch(auditResultUrl, {
method: 'POST',
redirect: 'error', // hard-block redirects — prevents post-validation CNAME switch
signal: AbortSignal.timeout(5000),
body: JSON.stringify({ auditId: req.params.id, status: 'complete' })
});
// Return only statusCode — never response body
res.json({ delivered: true, statusCode: response.status });
});
Hostname-only SSRF guards are bypassed by CNAME chains. An attacker registers safe-looking-domain.com pointing via CNAME to vault.internal; the guard checks the submitted hostname and passes, but the actual TCP connection goes to Vault. assertSafeExternalUrl() must resolve all CNAME hops to their final A/AAAA records and validate every IP in the chain. Combine with redirect: 'error' to prevent runtime redirect hijacking after the guard passes.
SSRF84-004 — Review export URL fetches etcd and stores raw config data persistently
The review export endpoint accepts a reviewExportUrl from which it retrieves external review data to import into the registry as a review record. The raw HTTP response body from the fetched URL is stored verbatim as the review's import data and is subsequently accessible through the review history API. An attacker supplies reviewExportUrl pointing to http://etcd:2379/v3/kv/range; the registry fetches the etcd endpoint over the internal network, the raw etcd key-value configuration data is stored as a persistent review record, and the attacker retrieves the full etcd data dump at any time by querying the review history API — a stable, long-lived exfiltration artifact that persists even after the SSRF vulnerability is patched.
// SSRF84-004 — VULNERABLE: reviewExportUrl fetched; raw response stored as review record
router.post('/reviews/import', requireSession, async (req, res) => {
const { reviewExportUrl } = req.body;
// attacker sets to http://etcd:2379/v3/kv/range
const response = await fetch(reviewExportUrl);
// raw etcd config data stored as review record
const rawBody = await response.text();
const review = await reviewService.createFromImport({
importedBy: req.session.userId,
rawData: rawBody, // etcd config data now queryable via review history API
sourceUrl: reviewExportUrl
});
res.json({ reviewId: review.id });
});
// SSRF84-004 — FIXED: assertSafeExternalUrl(); HEAD-only; store only URL and probeStatusCode
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
router.post('/reviews/import', requireSession, async (req, res) => {
const { reviewExportUrl } = req.body;
await assertSafeExternalUrl(reviewExportUrl);
// HEAD probe only — confirms URL is reachable, reads no body
const probe = await fetch(reviewExportUrl, {
method: 'HEAD',
redirect: 'error',
signal: AbortSignal.timeout(5000)
});
// Store only URL and probe status — never response body
const review = await reviewService.createImportRecord({
importedBy: req.session.userId,
sourceUrl: reviewExportUrl,
probeStatusCode: probe.status
// rawData field intentionally omitted
});
res.json({ reviewId: review.id });
});
Persistent SSRF is worse than transient SSRF because the exfiltrated data outlives the vulnerability. Even after patching, an attacker who triggered SSRF84-004 retains access to the etcd data dump through the review history API indefinitely. After patching, audit all review import records for sourceUrl values resolving to private address space and purge any records where rawData contains non-review content. Store only the minimum metadata needed to audit the import action itself.
SkillAudit checks for all SA-SKL-SSRF vulnerability patterns including unvalidated callback URLs, redirect-following SSRF, CNAME chain bypass, and persistent SSRF via stored response bodies. Get a graded report with line-level code fixes in 60 seconds.
Get a free audit