Claude MCP skill SSRF — skill notification and alert delivery endpoints — SA-SKL-SSRF62
SA-SKL-SSRF62 documents four server-side request forgery vulnerabilities in MCP skill registry skill notification and alert delivery endpoints. Notification and alert delivery systems are high-value SSRF targets because they are designed to make outbound HTTP requests to user-supplied URLs as a core feature — the boundary between intended functionality and exploitation is defined entirely by input validation quality. SSRF62 identifies four distinct SSRF attack paths: metadata credential theft via the notification webhook URL field reaching the cloud instance metadata endpoint; Consul service catalog exfiltration via the alert confirmation URL; Vault KV secret exfiltration via the escalation target URL exploiting redirect-following behavior; and persistent etcd configuration data storage via the digest delivery URL that stores raw response bodies as registry records.
notificationWebhookUrl — 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 booleanalertConfirmationUrl — attacker points to Consul:8500; Consul catalog JSON returned as alert confirmation containing full internal network topology; fix: allowlist; Zod parse only boolean confirmed; never proxy raw response bodyescalationTargetUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secrets as escalation confirmation; fix: redirect:error; allowlist; extract only structured escalation schemadigestDeliveryUrl and stores raw response as digest record — attacker points to etcd:2379; etcd configuration data stored persistently as digest record readable via notification history API; fix: allowlist; return only boolean delivered; never store raw response bodySSRF62-001 — Metadata credential theft via notificationWebhookUrl
Severity: CRITICAL
The notification delivery endpoint accepts a user-supplied notificationWebhookUrl parameter and makes a server-side HTTP POST request to that URL to deliver the notification payload. No validation is applied to the URL beyond checking that it is syntactically valid. An attacker sets notificationWebhookUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/ — the AWS instance metadata service endpoint. The registry server fetches this URL from its cloud-hosted instance and receives the IAM role name, then follows up with a request to http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> to obtain the full access key, secret key, and session token for the instance's IAM role.
The IAM credentials are embedded in the notification delivery confirmation response body and returned directly to the attacker. These credentials provide access to all AWS services that the registry instance's IAM role is authorized to use — including S3 buckets containing skill packages, RDS database endpoints, and Secrets Manager entries storing third-party API keys. The attack requires only a valid registry user account with permission to configure notification webhooks, which is a standard feature available to all skill publishers.
Never fetch user-supplied URLs from application servers without strict allowlisting and DNS-level private-IP blocking. Cloud metadata endpoints at 169.254.169.254 (AWS/Azure), metadata.google.internal (GCP), and similar addresses are reachable from any server in the VPC and return IAM credentials that provide cloud-wide access. URL validation must include DNS resolution of the final IP followed by comparison against a private IP block list, applied before each request to prevent TOCTOU attacks.
// POST /api/notifications/deliver — fetches user-supplied URL, returns raw response
async function deliverNotification(notificationWebhookUrl, payload) {
// no URL validation, no DNS check, no allowlist
const response = await fetch(notificationWebhookUrl, {
method: 'POST',
body: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' },
});
const confirmation = await response.json();
// attacker receives IAM credentials embedded in confirmation
return { delivered: true, confirmation };
}
// POST /api/notifications/deliver — allowlist + DNS private-IP block + status-only response
import { isPrivateIP } from 'is-private-ip';
import dns from 'node:dns/promises';
import { z } from 'zod';
const WEBHOOK_ALLOWLIST_PATTERN = /^https:\/\/hooks\.(slack|teams|discord)\.com\//;
async function validateWebhookUrl(url: string): Promise {
if (!WEBHOOK_ALLOWLIST_PATTERN.test(url)) {
throw new Error('Webhook URL not in allowlist');
}
const { hostname } = new URL(url);
const addresses = await dns.resolve4(hostname);
for (const addr of addresses) {
if (isPrivateIP(addr)) throw new Error('Webhook URL resolves to private IP');
}
}
async function deliverNotification(notificationWebhookUrl: string, payload: NotificationPayload) {
await validateWebhookUrl(notificationWebhookUrl);
const response = await fetch(notificationWebhookUrl, {
method: 'POST',
body: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' },
redirect: 'error', // prevent redirect chains to internal endpoints
signal: AbortSignal.timeout(5000),
});
// return only boolean — never proxy response body to caller
return { delivered: response.ok };
}
SSRF62-002 — Consul topology leak via alertConfirmationUrl
Severity: CRITICAL
The alert confirmation endpoint accepts a user-supplied alertConfirmationUrl and makes a server-side GET request to that URL to verify that the alert was received. The raw response body is parsed as JSON and returned to the caller as the alert confirmation payload. An attacker sets alertConfirmationUrl to http://consul:8500/v1/catalog/services. The registry server fetches this URL and receives the Consul service catalog — a JSON object mapping every service name in the internal network to its list of registered tags. This catalog reveals the full internal service topology, including service names that can be used as hostnames for further SSRF attacks against specific internal services.
The attacker can then iterate through the returned service names and query http://consul:8500/v1/catalog/service/<name> for each service to obtain the full list of service instances, their IP addresses, ports, health check endpoints, and registered metadata. This provides a complete network map of the internal infrastructure — including services that are not reachable from the external internet but are reachable from the registry application server within the same network segment.
Never proxy raw response bodies from server-side HTTP requests back to API callers. Alert confirmation endpoints must parse the response from the confirmation URL using a strict schema that extracts only the boolean confirmed status. Any additional data in the response — including infrastructure service catalogs, database connection strings, or internal API responses — must be discarded before the confirmation status is returned to the caller.
// GET /api/alerts/confirm — fetches alertConfirmationUrl, proxies raw response to caller
async function confirmAlert(alertConfirmationUrl) {
// no URL validation — attacker points to consul:8500/v1/catalog/services
const response = await fetch(alertConfirmationUrl);
const body = await response.json();
// Consul service catalog returned verbatim to attacker as alert confirmation
return { confirmed: true, details: body };
}
// GET /api/alerts/confirm — allowlist + Zod-parse boolean only + discard response body
import { z } from 'zod';
const AlertConfirmationResponseSchema = z.object({
confirmed: z.boolean(),
}).strict();
async function confirmAlert(alertConfirmationUrl: string) {
await validateWebhookUrl(alertConfirmationUrl); // same allowlist + DNS check as SSRF62-001 fix
const response = await fetch(alertConfirmationUrl, {
redirect: 'error',
signal: AbortSignal.timeout(5000),
});
if (!response.ok) return { confirmed: false };
const rawBody = await response.json();
const parsed = AlertConfirmationResponseSchema.safeParse(rawBody);
// return only the boolean — discard everything else including catalog data
return { confirmed: parsed.success ? parsed.data.confirmed : false };
}
SSRF62-003 — Vault secret exfiltration via escalationTargetUrl with redirect:follow
Severity: CRITICAL
The escalation notification endpoint fetches the user-supplied escalationTargetUrl with redirect: 'follow' (the default for the node-fetch and native fetch APIs). An attacker registers a CNAME DNS record that points to vault — the internal Vault service hostname — and sets escalationTargetUrl to a URL under a domain they control. The external domain resolves initially to an attacker-controlled server that returns a 301 redirect to http://vault:8200/v1/secret/data/registry/credentials. The fetch client follows the redirect to the internal Vault endpoint and returns the KV secrets — including database passwords, third-party API keys, and signing certificates — as the escalation confirmation response.
The redirect: 'follow' option allows the initial URL allowlist check (if any) to pass validation while the actual request is made to an internal endpoint that bypasses allowlisting. This is the classic open-redirect SSRF bypass. The fix requires setting redirect: 'error' so that any redirect from the initial fetch target causes the request to fail immediately, preventing the redirect chain from reaching internal endpoints.
Always set redirect: 'error' when fetching user-supplied URLs. Redirect-following SSRF is the most common allowlist bypass technique. Even if the initial URL passes allowlist validation, a redirect to an internal endpoint bypasses the check. Setting redirect: 'error' in the fetch options prevents all redirect chains regardless of destination and must be applied before allowlist validation can be considered effective.
// POST /api/escalations/notify — fetches escalationTargetUrl with redirect:follow (default)
async function sendEscalationNotification(escalationTargetUrl, escalationPayload) {
// redirect: 'follow' by default — attacker uses open redirect to vault:8200
const response = await fetch(escalationTargetUrl, {
method: 'POST',
body: JSON.stringify(escalationPayload),
headers: { 'Content-Type': 'application/json' },
// missing: redirect: 'error'
});
const confirmation = await response.json();
// Vault KV secrets returned to attacker as escalation confirmation
return { escalated: true, confirmation };
}
// POST /api/escalations/notify — redirect:error + allowlist + schema-only response
import { z } from 'zod';
const EscalationConfirmationSchema = z.object({
received: z.boolean(),
escalationId: z.string().uuid().optional(),
}).strict();
async function sendEscalationNotification(escalationTargetUrl: string, escalationPayload: EscalationPayload) {
await validateWebhookUrl(escalationTargetUrl); // allowlist + DNS check
const response = await fetch(escalationTargetUrl, {
method: 'POST',
body: JSON.stringify(escalationPayload),
headers: { 'Content-Type': 'application/json' },
redirect: 'error', // critical: reject any redirect regardless of destination
signal: AbortSignal.timeout(5000),
});
if (!response.ok) return { escalated: false };
const rawBody = await response.json();
const parsed = EscalationConfirmationSchema.safeParse(rawBody);
// return only validated schema fields — never proxy raw response body
return { escalated: true, escalationId: parsed.success ? parsed.data.escalationId : undefined };
}
SSRF62-004 — etcd data persistence via digestDeliveryUrl with raw response storage
Severity: HIGH
The digest delivery endpoint fetches the user-supplied digestDeliveryUrl and stores the raw response body as a digest delivery record in the registry database. These records are subsequently readable via the notification history API by any user with access to the registry account. An attacker sets digestDeliveryUrl to http://etcd:2379/v3/kv/range — the etcd v3 KV range endpoint. The registry server fetches this URL and receives the full etcd key-value store contents, which are then stored persistently as a digest delivery record. The attacker can read the etcd data at any time through the notification history API without requiring direct access to the etcd endpoint.
The persistence of the exfiltrated data is what elevates this finding. Even after the SSRF vulnerability is patched, the etcd configuration data remains in the registry database as a historical digest record until it is explicitly purged. This data may include etcd cluster member configurations, network overlay settings, TLS certificate paths, and application configuration values that were stored in etcd — providing persistent access to infrastructure configuration data that can be used to plan further attacks even after the initial vector is closed.
Never store raw response bodies from user-supplied URL fetches in the database. Any endpoint that fetches a user-supplied URL and stores the response body creates a persistent SSRF data exfiltration channel. The stored data is readable by the attacker indefinitely after the fetch, even if the SSRF vector is subsequently patched. Digest delivery endpoints must return only a boolean delivered status and must never store or return the raw response body.
// POST /api/digest/deliver — fetches digestDeliveryUrl, stores raw response in DB
async function deliverDigest(digestDeliveryUrl, digestPayload, userId) {
const response = await fetch(digestDeliveryUrl, {
method: 'POST',
body: JSON.stringify(digestPayload),
});
const responseBody = await response.text();
// attacker's etcd data stored persistently as digest record
await DigestRecord.create({
userId,
deliveryUrl: digestDeliveryUrl,
responseBody, // raw etcd KV data stored here
deliveredAt: new Date(),
});
return { delivered: true };
}
// POST /api/digest/deliver — allowlist + redirect:error + boolean-only record
async function deliverDigest(digestDeliveryUrl: string, digestPayload: DigestPayload, userId: string) {
await validateWebhookUrl(digestDeliveryUrl); // allowlist + DNS check
const response = await fetch(digestDeliveryUrl, {
method: 'POST',
body: JSON.stringify(digestPayload),
headers: { 'Content-Type': 'application/json' },
redirect: 'error',
signal: AbortSignal.timeout(5000),
});
// store only boolean delivered status — never store raw response body
await DigestRecord.create({
userId,
deliveryUrl: new URL(digestDeliveryUrl).hostname, // store hostname only, not full URL
delivered: response.ok,
deliveredAt: new Date(),
// no responseBody field
});
return { delivered: response.ok };
}
All four SA-SKL-SSRF62 vulnerabilities reflect a consistent pattern of insufficient URL validation on notification and alert delivery endpoints that make outbound HTTP requests as a core feature. SkillAudit detects SSRF62-001 and SSRF62-002 by identifying fetch() or axios.get() calls where the URL is sourced from request body fields without DNS-level private-IP blocking; SSRF62-003 by detecting fetch() calls without explicit redirect: 'error' option on outbound webhook URLs; and SSRF62-004 by detecting patterns where the response body of an outbound fetch is stored in a database ORM create call. See also SA-SKL-SSRF61 on webhook and callback endpoints for the companion SSRF chain.
Compound attack chain: SSRF62-001 → SSRF62-003 → SSRF62-002 → SSRF62-004
The four SSRF62 findings compose into a progressive infrastructure reconnaissance and credential harvesting chain. An attacker first exploits SSRF62-001 to obtain IAM credentials from the cloud instance metadata endpoint via the notification webhook URL. These credentials provide access to AWS Secrets Manager, where the internal Vault and Consul authentication tokens may be stored. With IAM credentials in hand, the attacker can expand the attack to other SSRF vectors.
Using SSRF62-003, the attacker exploits the redirect-following behavior of the escalation endpoint to reach the internal Vault KV store and exfiltrate application secrets — including database passwords, signing keys, and third-party API tokens. These secrets enable direct database access, bypassing the need for further SSRF exploitation. The attacker then uses SSRF62-002 to map the internal network topology via Consul, identifying additional services that may be reachable via SSRF from the registry server.
Finally, SSRF62-004 provides a persistent storage channel: the attacker uses the digest delivery endpoint to fetch etcd configuration data and store it durably in the registry database. Even after all four SSRF vulnerabilities are patched, the etcd data remains in the notification history records, providing the attacker with persistent access to the infrastructure configuration snapshot captured before remediation.
SkillAudit detection
SkillAudit's static analysis rules detect all four SSRF62 vulnerability classes during CI pipeline scanning. The outbound URL fetch detector flags any fetch(), axios(), got(), or node-fetch call where the URL argument is derived from a request body field, query parameter, or database record without a preceding URL allowlist check function call in the same scope. The redirect-follow detector flags fetch calls where the redirect option is absent or set to 'follow' when the URL is not a compile-time constant. The raw response storage detector flags patterns where the return value of response.text(), response.json(), or response.body is passed directly as a field value to an ORM create or update call. All findings include remediation snippets and links to this advisory.