Claude MCP skill SSRF — skill collaboration and team workspace webhook endpoints (SA-SKL-SSRF89)
SA-SKL-SSRF89 identifies four server-side request forgery vulnerabilities in MCP skill registry skill collaboration and team workspace webhook endpoints. The team invite completion callback endpoint fetches a user-supplied teamInviteCallbackUrl without IP or hostname validation, allowing an attacker to point it to the cloud metadata service at 169.254.169.254 and receive the IAM role credentials attached to the registry's compute instance in the callback response body. The workspace export acknowledgment endpoint fetches a user-supplied workspaceExportUrl and returns the response body to the caller, allowing an attacker to redirect it to the Consul service discovery agent at port 8500 and read the full internal service catalog. The collaboration notification endpoint follows HTTP redirects without restriction when fetching a user-supplied collaborationWebhookUrl, enabling a CNAME chain that resolves through a public DNS record to HashiCorp Vault at port 8200 to return secrets stored in the KV engine. And the workspace import endpoint fetches a user-supplied workspaceImportUrl and stores the raw response body as a workspace record in the registry's database, allowing an attacker to point it to the etcd cluster at its default port and persist the etcd configuration data where it remains readable through the workspace history API.
teamInviteCallbackUrl — attacker sets to 169.254.169.254; IAM credentials in team invite callback response bodyworkspaceExportUrl — attacker points to Consul:8500; full service catalog as workspace export acknowledgment bodycollaborationWebhookUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secretsworkspaceImportUrl and stores raw response as workspace record — attacker points to etcd:2379; etcd config stored persistently via workspace history APISSRF89-001 — teamInviteCallbackUrl fetches IMDS returning IAM credentials in callback response
The team invite completion flow allows workspace administrators to specify a teamInviteCallbackUrl that the registry server fetches when a team member accepts an invitation, delivering the invite completion event payload to the administrator's webhook endpoint. The endpoint constructs a fetch() call using the user-supplied URL without validating that the target hostname resolves to a public IP address. When an attacker submits https://169.254.169.254/latest/meta-data/iam/security-credentials/ as the callback URL, the registry server contacts the AWS Instance Metadata Service from its own network interface and receives the name of the IAM role attached to the compute instance. A subsequent request to https://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> returns the full set of temporary credentials — AccessKeyId, SecretAccessKey, and SessionToken — which the registry server then forwards to the attacker as the callback response body.
The IAM role attached to the registry's compute instance typically carries permissions scoped to the registry's operational requirements: read and write access to the S3 buckets storing skill packages, read access to the Secrets Manager entries containing database credentials and API keys, and read access to the DynamoDB tables used for session management. An attacker who obtains these credentials through the IMDS callback can read every skill package stored in S3, extract every database credential and API key from Secrets Manager, and read session tokens from DynamoDB to impersonate any currently authenticated user. The credentials are valid for the duration of the IAM role's credential refresh interval — typically one hour — during which the attacker has unrestricted access to all resources accessible to the registry's compute instance role.
// SSRF89-001 — VULNERABLE: unvalidated teamInviteCallbackUrl fetches IMDS
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.post('/teams/:teamId/invites/:inviteId/complete',
requireSession,
async (req, res) => {
const invite = await db.getInvite(req.params.inviteId);
// No URL validation — attacker sets teamInviteCallbackUrl to 169.254.169.254
if (invite.teamInviteCallbackUrl) {
const callbackResp = await fetch(invite.teamInviteCallbackUrl, {
method: 'POST',
body: JSON.stringify({ inviteId: invite.id, acceptedBy: req.session.userId })
});
// Response body forwarded to caller — IAM credentials exfiltrated
const callbackBody = await callbackResp.text();
return res.json({ status: 'accepted', callbackResponse: callbackBody });
}
res.json({ status: 'accepted' });
}
);
module.exports = router;
Forwarding the callback response body to the API caller turns the SSRF into a direct IAM credential exfiltration channel — the attacker receives the credentials in the HTTP response body without needing any out-of-band exfiltration mechanism. assertSafeExternalUrl() must reject link-local addresses including 169.254.0.0/16, loopback, and RFC 1918 ranges before the fetch executes; redirect:error prevents CNAME chains from resolving through public DNS to private ranges; returning only the HTTP status code from the callback response eliminates the exfiltration channel entirely.
// SSRF89-001 — FIXED: assertSafeExternalUrl(); redirect:error; return only statusCode
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
const router = express.Router();
router.post('/teams/:teamId/invites/:inviteId/complete',
requireSession,
async (req, res) => {
const invite = await db.getInvite(req.params.inviteId);
if (invite.teamInviteCallbackUrl) {
// Throws if URL resolves to link-local, loopback, or RFC 1918 range
await assertSafeExternalUrl(invite.teamInviteCallbackUrl);
const callbackResp = await fetch(invite.teamInviteCallbackUrl, {
method: 'POST',
redirect: 'error', // no CNAME chain following
body: JSON.stringify({ inviteId: invite.id, status: 'accepted' })
});
// Return only HTTP status — response body never forwarded to caller
return res.json({ status: 'accepted', callbackStatusCode: callbackResp.status });
}
res.json({ status: 'accepted' });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H — Base Score 9.9 (CRITICAL); scope changed because IAM credentials grant access to all S3, Secrets Manager, and DynamoDB resources accessible to the registry's compute instance role, extending impact beyond the registry application boundary.
SSRF89-002 — workspaceExportUrl fetches Consul service catalog as acknowledgment body
The workspace export feature allows workspace administrators to trigger an export of their workspace configuration to an external system by supplying a workspaceExportUrl that the registry server POSTs the export payload to. The endpoint uses node-fetch with default settings and returns the acknowledgment response body from the target server as part of the API response to the administrator. When an attacker supplies http://consul-agent.internal:8500/v1/catalog/services as the export URL, the registry server queries the Consul service discovery HTTP API from inside the registry's internal network and receives a JSON object enumerating every registered service by name and tag. A subsequent request to /v1/catalog/service/<name> returns the full service registration including addresses, ports, health check endpoints, and service metadata tags that may contain internal documentation references, environment labels, and infrastructure configuration hints.
The Consul service catalog represents the complete map of the registry's internal architecture: the names and addresses of every microservice, the ports on which they accept connections, the health check paths used to verify their availability, and the tags that document their role, version, and configuration profile. This information is architecturally sensitive because it allows an attacker to identify high-value internal targets — the billing service, the audit database proxy, the secret rotation service — and their internal addresses and ports, which are the prerequisites for further internal network pivoting once an initial SSRF entry point is established.
// SSRF89-002 — VULNERABLE: unvalidated workspaceExportUrl fetches Consul catalog
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.post('/workspaces/:workspaceId/export',
requireSession,
async (req, res) => {
const workspace = await db.getWorkspace(req.params.workspaceId);
const exportPayload = await buildExportPayload(workspace);
// No URL validation — attacker points to Consul:8500
const ackResp = await fetch(req.body.workspaceExportUrl, {
method: 'POST',
body: JSON.stringify(exportPayload)
});
const ackBody = await ackResp.json();
// Consul service catalog returned as export acknowledgment body
res.json({ exported: true, acknowledgment: ackBody });
}
);
module.exports = router;
Returning the response body from an unvalidated internal URL turns every workspace export into a potential Consul service catalog read — the attacker receives the full internal service map as the export acknowledgment. assertSafeExternalUrl() with pre-resolution DNS validation rejects hostnames that resolve to RFC 1918 or link-local ranges; HEAD-only probing verifies the target accepts requests without sending the export payload to an internal service; returning only the HTTP status code eliminates the response body exfiltration channel.
// SSRF89-002 — FIXED: assertSafeExternalUrl(); HEAD-only probe; return only statusCode
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
const router = express.Router();
router.post('/workspaces/:workspaceId/export',
requireSession,
async (req, res) => {
const workspace = await db.getWorkspace(req.params.workspaceId);
// Throws if URL resolves to RFC 1918, link-local, or loopback range
await assertSafeExternalUrl(req.body.workspaceExportUrl);
// HEAD probe verifies target accepts requests — no body sent to internal service
const probe = await fetch(req.body.workspaceExportUrl, {
method: 'HEAD',
redirect: 'error'
});
if (!probe.ok) {
return res.status(400).json({ error: 'Export URL probe failed' });
}
const exportPayload = await buildExportPayload(workspace);
const ackResp = await fetch(req.body.workspaceExportUrl, {
method: 'POST',
redirect: 'error',
body: JSON.stringify(exportPayload)
});
// Return only HTTP status — response body never forwarded to caller
res.json({ exported: true, acknowledgmentStatusCode: ackResp.status });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N — Base Score 8.5 (HIGH); scope changed because Consul catalog exposure reveals the complete internal service mesh topology, enabling targeted follow-on attacks against high-value internal services whose existence and addresses were previously unknown to the attacker.
SSRF89-003 — collaborationWebhookUrl CNAME chain to Vault:8200 returns KV secrets
The collaboration notification system delivers real-time events — member additions, permission changes, and skill sharing events — to workspace integrations by fetching a user-supplied collaborationWebhookUrl. The endpoint uses node-fetch with redirect: 'follow', which causes the HTTP client to follow both HTTP 301/302 redirects and DNS CNAME redirects transparently. An attacker who controls a public DNS record can configure a CNAME chain that routes through legitimately resolvable public hostnames before terminating at an internal address: for example, attacker-webhook.example.com resolves to a CNAME pointing to vault-proxy.example.com, which resolves to a CNAME pointing to vault.internal, which the registry's internal DNS resolves to the HashiCorp Vault server at 10.0.1.50:8200. Because the IP validation in the SSRF guard runs only against the initial hostname and not against the final resolved address after CNAME following, the redirect chain bypasses the guard and the registry server contacts the Vault HTTP API directly.
Once the CNAME chain resolves to Vault, the GET request to /v1/secret/data/registry returns the contents of the registry's KV secrets namespace, which typically includes database connection strings, Anthropic API keys, Stripe secret keys, and the registry's signing key used to generate audit report signatures. The KV secrets are returned in the HTTP response body, which the registry server receives and may log to its access or error log — creating a secondary persistence path for the credential exfiltration even if the response is not forwarded to the caller. The redirect: 'follow' setting is the direct enabler of this attack; restricting redirect following to redirect: 'error' breaks the CNAME chain at the first redirect step and prevents the final Vault contact regardless of the DNS configuration.
// SSRF89-003 — VULNERABLE: redirect:follow enables CNAME chain to Vault:8200
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
const router = express.Router();
router.post('/workspaces/:workspaceId/collaboration/notify',
requireSession,
async (req, res) => {
const workspace = await db.getWorkspace(req.params.workspaceId);
// assertSafeExternalUrl checks initial hostname only — CNAME chain bypasses it
await assertSafeExternalUrl(workspace.collaborationWebhookUrl);
const notifyResp = await fetch(workspace.collaborationWebhookUrl, {
method: 'POST',
redirect: 'follow', // CNAME chain to Vault:8200 followed transparently
body: JSON.stringify(req.body.event)
});
res.json({ notified: true, statusCode: notifyResp.status });
}
);
module.exports = router;
redirect:follow makes the SSRF guard's hostname check ineffective against CNAME chains — the guard approves the initial public hostname, then the HTTP client silently routes to Vault via DNS indirection. Setting redirect:error breaks the CNAME chain at the first redirect step, regardless of how many public hostnames the chain passes through; combined with post-resolution IP validation that checks the final resolved IP against RFC 1918 and link-local ranges, this closes both the redirect-following and CNAME-chaining attack paths.
// SSRF89-003 — FIXED: assertSafeExternalUrl(); redirect:error; return only statusCode
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
const router = express.Router();
router.post('/workspaces/:workspaceId/collaboration/notify',
requireSession,
async (req, res) => {
const workspace = await db.getWorkspace(req.params.workspaceId);
// assertSafeExternalUrl with DNS pre-resolution validates final resolved IP
await assertSafeExternalUrl(workspace.collaborationWebhookUrl, {
resolveAndCheck: true // validates resolved IP, not just hostname
});
const notifyResp = await fetch(workspace.collaborationWebhookUrl, {
method: 'POST',
redirect: 'error', // breaks CNAME chain at first redirect step
body: JSON.stringify(req.body.event)
});
// Return only HTTP status — response body never forwarded to caller
res.json({ notified: true, statusCode: notifyResp.status });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H — Base Score 8.5 (HIGH); attack complexity is HIGH because CNAME chain setup requires attacker-controlled DNS; scope changed because Vault KV exposure grants access to all registry secrets including database credentials and signing keys.
SSRF89-004 — workspaceImportUrl fetches etcd:2379 and stores config persistently via workspace history
The workspace import feature allows administrators to restore a workspace configuration from an external source by supplying a workspaceImportUrl that the registry server fetches and stores as the imported workspace record. The endpoint stores the raw HTTP response body from the fetched URL as the new workspace configuration document in the database, then creates a workspace history entry pointing to the imported record. When an attacker supplies http://etcd.internal:2379/v3/kv/range as the import URL, the registry server contacts the etcd cluster's gRPC-Gateway HTTP API and receives the full contents of all key-value pairs stored in etcd — including distributed lock states, service configuration objects, cluster membership records, and any secrets stored in etcd by the registry's configuration management tooling.
The persistence mechanism makes this finding materially more severe than a standard SSRF read. Because the etcd response body is stored as a workspace record in the registry's database, it remains readable through the workspace history API indefinitely after the import event. Any team member with workspace read access can retrieve the stored etcd configuration at any point in the future by querying the workspace history endpoint — the attacker does not need to re-trigger the SSRF to access the data after the initial import. Additionally, workspace history records are included in workspace exports, meaning the etcd configuration data may propagate to external systems if the workspace is later exported for backup or migration purposes.
// SSRF89-004 — VULNERABLE: unvalidated workspaceImportUrl stores etcd response persistently
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.post('/workspaces/:workspaceId/import',
requireSession,
async (req, res) => {
// No URL validation — attacker points to etcd:2379
const importResp = await fetch(req.body.workspaceImportUrl);
const importBody = await importResp.text();
// Raw response body stored as workspace record — etcd config persisted
const record = await db.createWorkspaceImportRecord({
workspaceId: req.params.workspaceId,
importUrl: req.body.workspaceImportUrl,
importedConfig: importBody, // etcd kv/range response stored here
importedAt: new Date(),
importedBy: req.session.userId
});
res.json({ importId: record.id, status: 'imported' });
}
);
module.exports = router;
Storing the raw response body from an unvalidated internal URL creates a persistent SSRF artifact — the etcd configuration remains readable through the workspace history API long after the initial import event, and propagates to any system that receives a workspace export. assertSafeExternalUrl() with pre-resolution DNS validation rejects hostnames that resolve to internal ranges; HEAD-only probing verifies the import source without reading the response body; storing only the URL and probe status code — not the imported content — eliminates the persistent storage attack path entirely.
// SSRF89-004 — FIXED: assertSafeExternalUrl(); HEAD-only; store only URL and probeStatusCode
const express = require('express');
const fetch = require('node-fetch');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
const router = express.Router();
router.post('/workspaces/:workspaceId/import',
requireSession,
async (req, res) => {
// Throws if URL resolves to RFC 1918, link-local, or loopback range
await assertSafeExternalUrl(req.body.workspaceImportUrl);
// HEAD probe verifies source availability — response body never read
const probe = await fetch(req.body.workspaceImportUrl, {
method: 'HEAD',
redirect: 'error'
});
// Store only URL and probe status — no response body persisted
const record = await db.createWorkspaceImportRecord({
workspaceId: req.params.workspaceId,
importUrl: req.body.workspaceImportUrl,
probeStatusCode: probe.status,
importedAt: new Date(),
importedBy: req.session.userId
});
res.json({ importId: record.id, probeStatusCode: probe.status });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N — Base Score 9.1 (CRITICAL); scope changed because etcd configuration exposure reveals cluster membership, distributed lock state, and secrets stored by configuration management tooling; persistence via workspace history extends the impact window indefinitely beyond the initial fetch event.
SkillAudit checks for all SA-SKL-SSRF vulnerability patterns including IMDS credential leakage via team invite callbacks, Consul service catalog exposure via workspace export URLs, Vault KV access via CNAME chain redirect following, and persistent etcd configuration storage via workspace import endpoints. Get a graded report with line-level code fixes in 60 seconds.
Get a free audit