Claude MCP skill SSRF — skill notification and alert delivery endpoints — SA-SKL-SSRF57
SA-SKL-SSRF57 documents four Server-Side Request Forgery vulnerabilities in MCP skill registry skill notification and alert delivery endpoints. Notification infrastructure is a natural SSRF target because it is explicitly designed to fetch URLs supplied by users — the delivery mechanism requires reaching out to user-specified endpoints, and disabling all outbound fetches would break the product. The challenge is constraining which URLs the server will reach. SSRF57-001 exploits a notification dispatch endpoint that fetches the caller-supplied delivery URL and returns the full response body, reaching the EC2 instance metadata service and returning IAM credentials. SSRF57-002 exploits an alert escalation endpoint that proxies raw escalation webhook responses, reaching Consul and returning the full internal network catalog. SSRF57-003 exploits a retry endpoint that follows redirects, allowing a CNAME chain to reach Vault and return KV secrets. SSRF57-004 exploits a subscription verification endpoint that stores the full response body as the subscription record, reaching etcd and persisting cluster configuration data as a readable notification history entry.
notificationDeliveryUrl; attacker sets to 169.254.169.254; IAM credentials embedded in notification delivery confirmation response returned to caller; fix: allowlist; DNS private-IP block; redirect:error; return only HTTP status booleanescalationWebhookUrl; attacker points to Consul:8500; Consul catalog JSON returned as escalation delivery confirmation containing full internal network topology; fix: allowlist; Zod parse only boolean delivered; never proxy raw response bodyretryDeliveryUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as retry confirmation; fix: redirect:error; allowlist; extract only structured notification schemaverificationUrl for HMAC challenge; attacker points to etcd:2379; etcd configuration data returned as HMAC challenge response stored as subscription record readable via notification history API; fix: allowlist; return only boolean verified; never store raw response bodySSRF57-001 — SSRF on notification dispatch URL fetches IAM metadata credentials
Severity: CRITICAL
The notification dispatch endpoint accepts a notificationDeliveryUrl parameter from the request body. The server fetches this URL to deliver the notification payload and returns the full HTTP response body as the delivery confirmation embedded in the API response. An attacker sets notificationDeliveryUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/. The fetch reaches the EC2 instance metadata service, which returns the name of the IAM role attached to the instance. A second request to http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> returns the full temporary credentials: AccessKeyId, SecretAccessKey, and Token. These are returned as the notification delivery confirmation in the API response, giving the attacker valid AWS credentials with the registry server's full IAM permissions. On GCP or Azure, the equivalent metadata endpoints return OAuth tokens and subscription credentials respectively.
// Notification dispatch — SSRF via user-supplied delivery URL
router.post('/notifications/dispatch', requireSession, async (req, res) => {
const { notificationDeliveryUrl, payload } = req.body;
const deliveryRes = await fetch(notificationDeliveryUrl, {
method: 'POST',
body: JSON.stringify(payload),
});
const confirmation = await deliveryRes.text(); // attacker gets this
return res.json({ delivered: true, confirmation }); // IAM creds returned here
});
// Notification dispatch — allowlist + private-IP block + status-only response
const { isPrivateIP } = require('range_check');
async function safeNotificationFetch(url, payload) {
const parsed = new URL(url);
if (!['https:', 'http:'].includes(parsed.protocol)) throw new Error('Invalid protocol');
const resolved = await dns.promises.lookup(parsed.hostname);
if (isPrivateIP(resolved.address)) throw new Error('Private IP blocked');
const allowed = process.env.NOTIFICATION_DELIVERY_ALLOWLIST.split(',');
if (!allowed.some(a => parsed.hostname.endsWith(a))) throw new Error('Not in allowlist');
const res = await fetch(url, { method: 'POST', body: JSON.stringify(payload), redirect: 'error' });
return { delivered: res.ok, statusCode: res.status }; // never return response body
}
router.post('/notifications/dispatch', requireSession, async (req, res) => {
const { notificationDeliveryUrl, payload } = req.body;
const result = await safeNotificationFetch(notificationDeliveryUrl, payload);
return res.json(result);
});
SSRF57-002 — SSRF on alert escalation webhook returns Consul network topology
Severity: CRITICAL
The alert escalation endpoint fetches a user-supplied escalationWebhookUrl and proxies the raw response body back as the escalation delivery confirmation. An attacker registers a notification subscription with escalationWebhookUrl set to http://consul.service.consul:8500/v1/catalog/services. When an alert escalation fires, the server fetches the Consul catalog endpoint and returns the full JSON body — a complete map of every service registered in the internal network, including service names, port numbers, health check endpoints, and tag metadata. This internal network topology is exactly what an attacker needs to plan further lateral movement: identifying database services, internal APIs, and administrative interfaces that are not exposed externally. The fix validates the escalation URL against an allowlist and parses only a boolean delivered field from the response, never returning raw response content.
Never proxy raw response bodies from server-side fetch operations. Any endpoint that fetches a user-supplied URL and returns the response body is a data exfiltration channel regardless of the intended use case. Always extract only the structured fields you need from the response and discard the rest.
// Alert escalation — SSRF via proxied webhook response
router.post('/alerts/escalate', requireSession, async (req, res) => {
const { escalationWebhookUrl, alert } = req.body;
const webhookRes = await fetch(escalationWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(alert),
});
const body = await webhookRes.json(); // attacker controls what this contains
return res.json({ escalated: true, webhookResponse: body }); // Consul JSON returned here
});
// Alert escalation — allowlist + response body discarded
router.post('/alerts/escalate', requireSession, async (req, res) => {
const { escalationWebhookUrl, alert } = req.body;
const urlObj = new URL(escalationWebhookUrl);
const allowed = process.env.ESCALATION_WEBHOOK_ALLOWLIST.split(',');
if (!allowed.some(a => urlObj.hostname.endsWith(a))) {
return res.status(400).json({ error: 'Escalation webhook URL not in allowlist' });
}
const webhookRes = await fetch(escalationWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ alertId: alert.id }), // minimal payload, not full alert
redirect: 'error',
});
// Parse only a boolean — never return response body content
return res.json({ escalated: webhookRes.ok });
});
SSRF57-003 — SSRF on notification retry with redirect:follow reaches Vault KV secrets
Severity: CRITICAL
The notification retry endpoint fetches the user-supplied retryDeliveryUrl using redirect: 'follow'. An attacker registers a notification subscription with a retryDeliveryUrl pointing to an attacker-controlled DNS name that resolves to a CNAME pointing to vault.service.consul. The fetch follows the redirect chain and reaches the Vault HTTP API at http://vault.service.consul:8200/v1/secret/data/registry. Vault returns the KV secrets for the registry — database credentials, API keys, signing keys — as the retry delivery confirmation embedded in the API response. CNAME-based bypass is the standard technique for evading hostname-only allowlists that do not resolve DNS before validation: the allowlist check passes on the attacker-controlled hostname, and the CNAME redirect reaches the internal target after the check. The fix sets redirect: 'error' to prevent redirect following entirely, in addition to DNS resolution pre-validation.
// Notification retry — SSRF via redirect:follow
router.post('/notifications/retry', requireSession, async (req, res) => {
const { retryDeliveryUrl, notificationId } = req.body;
const retryRes = await fetch(retryDeliveryUrl, {
method: 'POST',
redirect: 'follow', // follows CNAME chain to Vault
body: JSON.stringify({ notificationId }),
});
const confirmation = await retryRes.json();
return res.json({ retried: true, confirmation }); // Vault secrets returned here
});
// Notification retry — redirect:error + DNS pre-validation
router.post('/notifications/retry', requireSession, async (req, res) => {
const { retryDeliveryUrl, notificationId } = req.body;
const urlObj = new URL(retryDeliveryUrl);
// DNS resolution before allowlist check — prevents CNAME bypass
const resolved = await dns.promises.lookup(urlObj.hostname);
if (isPrivateIP(resolved.address)) {
return res.status(400).json({ error: 'Private IP blocked' });
}
const allowed = process.env.NOTIFICATION_RETRY_ALLOWLIST.split(',');
if (!allowed.some(a => urlObj.hostname.endsWith(a))) {
return res.status(400).json({ error: 'URL not in allowlist' });
}
const retryRes = await fetch(retryDeliveryUrl, {
method: 'POST',
redirect: 'error', // never follow redirects
body: JSON.stringify({ notificationId }),
});
return res.json({ retried: retryRes.ok });
});
SSRF57-004 — SSRF on subscription verification stores etcd config as subscription record
Severity: HIGH
The notification subscription verification endpoint fetches the user-supplied verificationUrl to perform an HMAC challenge — the server sends a challenge token to the URL and expects the response to echo back the HMAC-signed challenge. The endpoint stores the full response body as the subscription verification record, which becomes readable via the notification history API. An attacker sets verificationUrl to http://etcd.service.consul:2379/v3/kv/range. The fetch reaches etcd's gRPC-gateway HTTP API, and the response — containing key-value pairs from the etcd cluster including service discovery configuration, TLS certificate paths, and feature flag state — is stored as the subscription verification record. Any user with notification history read access can then retrieve the etcd configuration data via the history API, without ever needing direct network access to the etcd endpoint. This persistence mechanism makes the exfiltration invisible to network egress monitoring that only inspects outbound connections.
// Subscription verification — SSRF + response body stored as record
router.post('/subscriptions/verify', requireSession, async (req, res) => {
const { verificationUrl, subscriptionId } = req.body;
const challenge = crypto.randomBytes(32).toString('hex');
const verifyRes = await fetch(verificationUrl, {
method: 'POST',
body: JSON.stringify({ challenge }),
});
const verificationRecord = await verifyRes.text(); // etcd data stored here
await Subscription.updateOne({ _id: subscriptionId }, {
verified: true,
verificationRecord, // persisted — readable via history API
});
return res.json({ verified: true });
});
// Subscription verification — allowlist + never store response body
router.post('/subscriptions/verify', requireSession, async (req, res) => {
const { verificationUrl, subscriptionId } = req.body;
const urlObj = new URL(verificationUrl);
const resolved = await dns.promises.lookup(urlObj.hostname);
if (isPrivateIP(resolved.address)) {
return res.status(400).json({ error: 'Private IP blocked' });
}
const allowed = process.env.VERIFICATION_URL_ALLOWLIST.split(',');
if (!allowed.some(a => urlObj.hostname.endsWith(a))) {
return res.status(400).json({ error: 'URL not in allowlist' });
}
const challenge = crypto.randomBytes(32).toString('hex');
const verifyRes = await fetch(verificationUrl, {
method: 'POST',
body: JSON.stringify({ challenge }),
redirect: 'error',
});
let verified = false;
if (verifyRes.ok) {
const body = await verifyRes.json();
// Extract only the HMAC response — never store raw body
const expectedHmac = hmacChallenge(challenge, process.env.VERIFICATION_SECRET);
verified = typeof body.hmac === 'string' && timingSafeEqual(body.hmac, expectedHmac);
}
await Subscription.updateOne({ _id: subscriptionId }, { verified }); // boolean only
return res.json({ verified });
});
Remediation summary
| Finding | Severity | Primary remediation | Secondary hardening |
|---|---|---|---|
| SSRF57-001 | Critical | Allowlist outbound URLs; DNS pre-resolution with private-IP block; redirect:error; return only boolean delivered status | Block cloud metadata IP ranges at VPC/firewall level; monitor for 169.254.169.254 in outbound logs |
| SSRF57-002 | Critical | Allowlist escalation webhook URLs; Zod parse only boolean from response; never return or log raw response body | Segment notification service from internal service mesh; audit all webhook-firing code paths |
| SSRF57-003 | Critical | redirect:error; DNS pre-resolution before allowlist check to prevent CNAME bypass; return only boolean retried | Block outbound CNAME resolution to .consul and .local domains at DNS resolver level |
| SSRF57-004 | High | Allowlist verification URLs; never store raw response body; extract and validate only HMAC field; store boolean verified flag only | Audit notification history API for large stored records indicating prior SSRF exploitation; consider verification record as ephemeral |
Scan your MCP skill registry notification and alert delivery endpoints for SSRF57 patterns. SkillAudit checks notification dispatch, escalation webhook, retry, and verification URL handling for SSRF vectors. See also SA-SKL-SSRF56 and SA-SKL-SSRF55. Connect at skillaudit.dev.