Claude MCP skill SSRF — skill review and approval workflow endpoints (SA-SKL-SSRF68)
SA-SKL-SSRF68 identifies four server-side request forgery vulnerabilities in MCP skill registry review and approval workflow endpoints. All four expose internal infrastructure — AWS IAM metadata, Consul service catalog, HashiCorp Vault KV secrets, and etcd configuration — by fetching user-supplied URLs without validation during review submission, approval notification, result webhook delivery, and audit sink registration.
reviewCallbackUrl; attacker sets to 169.254.169.254; IAM credentials returned in review callback confirmation responsenotificationUrl; attacker points to Consul:8500; full Consul service catalog returned as approval notification responsewebhookUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets; CNAME rebinding defeats allowlist controls checking only the initial hostnamesinkUrl and stores raw response body as audit record; attacker points to etcd:2379; etcd config stored persistently readable via review audit history APISSRF68-001 — IAM credential exfiltration via reviewCallbackUrl
The review submission endpoint accepts a reviewCallbackUrl parameter where the registry should POST the review result when processing completes. The registry fetches this URL to deliver the callback. Without URL validation, an attacker submits http://169.254.169.254/latest/meta-data/iam/security-credentials/ as the callback URL. The registry server — running on an EC2 instance or in ECS/EKS — fetches the metadata endpoint using its instance role and returns the full IAM credential response body in the review callback confirmation.
// SSRF68-001 — VULNERABLE
router.post('/reviews', requireSession, async (req, res) => {
const { skillId, reviewCallbackUrl } = req.body;
// VULNERABLE: no URL validation — fetches any URL including 169.254.169.254
const review = await db.reviews.create({ skillId, callbackUrl: reviewCallbackUrl });
// Later, when review processing completes:
const callbackResponse = await fetch(review.callbackUrl, {
method: 'POST',
body: JSON.stringify({ reviewId: review.id, status: 'complete' }),
});
const callbackBody = await callbackResponse.text();
res.json({ reviewId: review.id, callbackConfirmation: callbackBody });
// If callbackUrl = http://169.254.169.254/latest/meta-data/iam/security-credentials/role
// callbackBody contains AccessKeyId, SecretAccessKey, Token — returned to caller
});
// SSRF68-001 — FIXED
const PRIVATE_RANGES = [
/^127\./, /^10\./, /^172\.(1[6-9]|2\d|3[01])\./, /^192\.168\./,
/^169\.254\./, /^::1$/, /^fc/, /^fd/, /^fe80/,
];
function isPrivateUrl(urlStr) {
try {
const { hostname } = new URL(urlStr);
return PRIVATE_RANGES.some(r => r.test(hostname));
} catch { return true; }
}
router.post('/reviews', requireSession, async (req, res) => {
const { skillId, reviewCallbackUrl } = req.body;
if (reviewCallbackUrl && isPrivateUrl(reviewCallbackUrl)) {
return res.status(422).json({ error: 'reviewCallbackUrl must be a public HTTPS endpoint' });
}
const review = await db.reviews.create({ skillId, callbackUrl: reviewCallbackUrl });
// Later, when processing completes — do NOT return raw callback body
await fetch(review.callbackUrl, {
method: 'POST',
redirect: 'error', // FIXED: no redirect following
body: JSON.stringify({ reviewId: review.id, status: 'complete' }),
});
res.json({ reviewId: review.id, ok: true }); // FIXED: boolean only, not raw response
});
SSRF68-002 — Consul catalog exfiltration via notificationUrl
The approval notification endpoint fetches a user-supplied notificationUrl to send approval confirmation. An attacker submits http://consul.service.consul:8500/v1/catalog/services. The registry server, running in the same private network as the Consul cluster, successfully fetches the catalog and returns the full JSON response — including service names, addresses, ports, and health check endpoints — as the approval notification response body.
// SSRF68-002 — VULNERABLE
router.post('/reviews/:reviewId/approve', requireReviewer, async (req, res) => {
const { notificationUrl } = req.body;
await db.reviews.update({ status: 'approved' }, { where: { id: req.params.reviewId } });
// VULNERABLE: fetches any internal URL and returns response body
const notifResponse = await fetch(notificationUrl);
const notifBody = await notifResponse.json();
res.json({ approved: true, notificationResult: notifBody });
// notifBody = full Consul catalog if notificationUrl = http://consul:8500/v1/catalog/services
});
// SSRF68-002 — FIXED
router.post('/reviews/:reviewId/approve', requireReviewer, async (req, res) => {
const { notificationUrl } = req.body;
if (notificationUrl && isPrivateUrl(notificationUrl)) {
return res.status(422).json({ error: 'notificationUrl must be a public HTTPS endpoint' });
}
await db.reviews.update({ status: 'approved' }, { where: { id: req.params.reviewId } });
if (notificationUrl) {
await fetch(notificationUrl, {
method: 'POST',
redirect: 'error',
body: JSON.stringify({ reviewId: req.params.reviewId, status: 'approved' }),
signal: AbortSignal.timeout(5000),
}).catch(() => {}); // fire-and-forget, ignore failures
}
res.json({ approved: true }); // FIXED: never return notification response body
});
SSRF68-003 — CNAME-chain SSRF to Vault via redirect:follow on result webhook
The review result webhook endpoint fetches a user-supplied webhookUrl to deliver the review result. The fetch call uses the default redirect: 'follow' behaviour. An attacker registers a domain they control with a CNAME record pointing to vault.service.consul (the internal Vault address). When the registry fetches https://attacker-cname.example.com/webhook, the DNS resolution resolves to the Vault address via the CNAME chain. Even if the registry has an allowlist that blocks IP addresses in private ranges, the allowlist checks only the initial hostname, not the final resolved IP. The Vault KV API responds with secret key-value pairs that are returned in the webhook delivery confirmation response.
// SSRF68-003 — VULNERABLE
router.post('/reviews/:reviewId/result-webhook', requireReviewer, async (req, res) => {
const { webhookUrl } = req.body;
// VULNERABLE: redirect:follow — CNAME chain defeats hostname allowlist
const webhookResp = await fetch(webhookUrl, {
method: 'POST',
redirect: 'follow', // attacker CNAME → vault.service.consul:8200
body: JSON.stringify(reviewResult),
});
const webhookBody = await webhookResp.json();
res.json({ delivered: true, webhookResponse: webhookBody }); // Vault secrets returned
});
// SSRF68-003 — FIXED
router.post('/reviews/:reviewId/result-webhook', requireReviewer, async (req, res) => {
const { webhookUrl } = req.body;
// Validate URL — private range check on hostname
if (isPrivateUrl(webhookUrl)) {
return res.status(422).json({ error: 'webhookUrl must be a public HTTPS endpoint' });
}
await fetch(webhookUrl, {
method: 'POST',
redirect: 'error', // FIXED: no redirects — CNAME chains do not follow
body: JSON.stringify({ reviewId: req.params.reviewId, status: reviewResult.status }),
signal: AbortSignal.timeout(5000),
});
res.json({ delivered: true }); // FIXED: boolean only
});
CNAME rebinding bypasses IP allowlists: An allowlist that checks only whether the initial URL hostname is in a private IP range does not protect against CNAME chains. The DNS resolution happens after the hostname check, and the final IP can be an internal address. The only effective fix is to use redirect: 'error' (which prevents any redirect from following, including CNAME-induced HTTP redirects) and to perform DNS-layer validation using a DNS resolver that returns the resolved IP for validation before the fetch proceeds.
SSRF68-004 — etcd config stored persistently via audit sink registration
The review audit sink registration endpoint registers an external URL to receive copies of all review audit events. It validates the sink URL by fetching it once at registration time to confirm reachability. The raw response body is stored as the sinkHealthCheck field in the audit sink record. An attacker submits http://etcd.service.consul:2379/v2/keys/?recursive=true. The registry fetches the etcd endpoint, receives the full etcd key-value store listing including infrastructure secrets, and stores that JSON blob persistently in the database as the sink's health check response — readable by any user who can query the audit sink history API.
// SSRF68-004 — VULNERABLE
router.post('/audit-sinks', requireAdmin, async (req, res) => {
const { sinkUrl } = req.body;
// VULNERABLE: fetches sinkUrl and stores raw response body permanently
const healthResp = await fetch(sinkUrl);
const healthBody = await healthResp.text();
await db.auditSinks.create({
sinkUrl,
sinkHealthCheck: healthBody, // etcd full KV store stored here
lastCheckedAt: new Date(),
});
res.json({ registered: true });
});
// SSRF68-004 — FIXED
router.post('/audit-sinks', requireAdmin, async (req, res) => {
const { sinkUrl } = req.body;
if (isPrivateUrl(sinkUrl)) {
return res.status(422).json({ error: 'sinkUrl must be a public HTTPS endpoint' });
}
// Health check: boolean only — do NOT store response body
let healthy = false;
try {
const resp = await fetch(sinkUrl, {
method: 'HEAD', // HEAD request — no response body
redirect: 'error',
signal: AbortSignal.timeout(3000),
});
healthy = resp.ok;
} catch { healthy = false; }
await db.auditSinks.create({
sinkUrl,
sinkHealthy: healthy, // FIXED: boolean only, no response body stored
lastCheckedAt: new Date(),
});
res.json({ registered: true, healthy });
});
SkillAudit detection: The scanner identifies SSRF68 patterns using AST queries targeting fetch(req.body., axios.get(req.body., and got(req.body. patterns in review and approval route handlers, combined with absence of a redirect: 'error' option and absence of a private-range URL check. The persistent-storage variant (SSRF68-004) is additionally detected by queries finding .create({ calls that include the fetch response body. Submit your MCP skill registry at SkillAudit.