Claude MCP skill SSRF — skill package distribution and CDN origin endpoint management (SA-SKL-SSRF69)
SA-SKL-SSRF69 identifies four SSRF vulnerabilities in MCP skill registry package distribution and CDN origin endpoint management. CDN origin registration proxies user-supplied URLs and returns the response body, leaking cloud IAM credentials from the metadata API; the distribution manifest endpoint returns raw Consul catalog data to the caller; a CDN invalidation webhook with redirect:follow allows CNAME-based rebinding to Vault; and a distribution audit sink stores raw responses from attacker-controlled endpoints as persistent audit records.
cdnOriginUrl; attacker sets to 169.254.169.254; IAM credentials returned in CDN origin health check response; fix: private-IP allowlist; redirect:error; return boolean onlymanifestUrl; attacker points to Consul:8500; full Consul catalog returned as distribution manifest response containing full internal service mesh topologyinvalidationWebhookUrl with redirect:follow; CNAME chain to Vault:8200 returns KV secrets as invalidation confirmation; fix: redirect:error; allowlist; structured schema extraction onlyauditSinkUrl and stores raw response as audit record; attacker points to etcd:2379; etcd config stored persistently readable via distribution audit history APISSRF69-001 — CDN origin registration fetches user-supplied URL leaking IAM credentials
When a skill author registers a CDN origin for package distribution, the registry performs a health check by fetching the supplied cdnOriginUrl and verifying that the response contains the expected X-SkillAudit-Origin-Token header. The raw response body is returned to the caller as confirmation of the registration. An attacker registers a CDN origin pointing to the cloud metadata endpoint at http://169.254.169.254/latest/meta-data/iam/security-credentials/. The registry worker fetches the metadata endpoint using its instance role, and the IAM credential response — including AccessKeyId, SecretAccessKey, and Token — is returned directly to the attacker in the registration confirmation response.
// SSRF69-001 — VULNERABLE
router.post('/cdn-origins',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const { cdnOriginUrl } = req.body;
// VULNERABLE: fetches user-supplied URL and returns raw body
const healthCheck = await fetch(cdnOriginUrl);
const body = await healthCheck.text();
if (!healthCheck.headers.get('X-SkillAudit-Origin-Token')) {
return res.status(422).json({ error: 'Missing origin token header' });
}
await db.cdnOrigins.create({ skillId: req.params.id, url: cdnOriginUrl });
res.json({ ok: true, response: body }); // VULNERABLE: returns IAM creds to caller
}
);
// SSRF69-001 — FIXED
const PRIVATE_RANGES = [
/^10\./, /^172\.(1[6-9]|2\d|3[01])\./, /^192\.168\./,
/^127\./, /^169\.254\./, /^::1$/, /^fc00:/, /^fe80:/,
];
function isPrivateIp(url) {
const hostname = new URL(url).hostname;
return PRIVATE_RANGES.some(r => r.test(hostname));
}
router.post('/cdn-origins',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const { cdnOriginUrl } = req.body;
if (isPrivateIp(cdnOriginUrl)) {
return res.status(422).json({ error: 'Private IP ranges not permitted' });
}
// FIXED: redirect:error prevents CNAME-based rebinding; return boolean only
const healthCheck = await fetch(cdnOriginUrl, { redirect: 'error' });
const hasToken = healthCheck.headers.has('X-SkillAudit-Origin-Token');
if (!hasToken) {
return res.status(422).json({ error: 'Missing origin token header' });
}
await db.cdnOrigins.create({ skillId: req.params.id, url: cdnOriginUrl });
res.json({ ok: true }); // FIXED: boolean only — no response body proxied
}
);
IAM credential impact: The attacker receives AccessKeyId, SecretAccessKey, and the session Token for the registry worker's IAM role. This role typically has S3 PutObject access to the skill artifact bucket and read access to the registry configuration store. The temporary credentials are valid for the remaining TTL of the instance role session (up to 6 hours), providing persistent cloud infrastructure access.
SSRF69-002 — Distribution manifest endpoint fetches Consul catalog
The distribution manifest endpoint allows skill authors to point to an external manifest URL describing the package distribution tree (artifact checksums, CDN distribution nodes, and edge cache configuration). The registry fetches the manifest and returns it to the caller for validation. An attacker supplies a manifestUrl pointing to the internal Consul HTTP API at http://consul:8500/v1/catalog/services. The endpoint returns the raw Consul catalog JSON response as the manifest body, exposing the full list of internal service names, addresses, and health check endpoints.
// SSRF69-002 — VULNERABLE
router.post('/distribution-manifests/validate',
requireSession,
async (req, res) => {
const { manifestUrl } = req.body;
// VULNERABLE: fetches any URL and returns full response body
const resp = await fetch(manifestUrl);
const manifest = await resp.json();
res.json({ ok: true, manifest }); // VULNERABLE: Consul catalog returned to caller
}
);
// SSRF69-002 — FIXED
const ManifestSchema = z.object({
schemaVersion: z.literal('1.0'),
artifacts: z.array(z.object({
name: z.string(),
sha256: z.string().regex(/^[a-f0-9]{64}$/),
})),
cdnNodes: z.array(z.string().url()),
});
const CDN_ORIGIN_ALLOWLIST = new Set([
'cdn.skillaudit.dev',
'assets.skillaudit.dev',
]);
router.post('/distribution-manifests/validate',
requireSession,
async (req, res) => {
const { manifestUrl } = req.body;
const parsed = new URL(manifestUrl);
if (!CDN_ORIGIN_ALLOWLIST.has(parsed.hostname)) {
return res.status(422).json({ error: 'manifestUrl not in permitted CDN origin' });
}
const resp = await fetch(manifestUrl, { redirect: 'error' });
const raw = await resp.json();
// FIXED: Zod parse — only extract known fields; Consul catalog keys are dropped
const manifest = ManifestSchema.parse(raw);
res.json({ ok: true, manifest });
}
);
SSRF69-003 — CDN invalidation webhook CNAME chain to Vault
When a new skill release is published, the registry sends an invalidation notification to the CDN origin's registered webhook URL. The webhook fetch uses redirect:follow, which allows an attacker to register a CDN origin whose webhook URL is a CNAME that resolves to vault.internal:8200. Because the allowlist check validates only the initial hostname before DNS resolution, the CNAME rebinding bypasses the allowlist. The Vault HTTP API responds to the webhook POST with its KV store data, which the caller can retrieve from the invalidation confirmation response.
// SSRF69-003 — VULNERABLE
async function sendCdnInvalidation(skillId, releaseId) {
const origin = await db.cdnOrigins.findOne({ skillId });
if (!origin) return;
// VULNERABLE: redirect:follow allows CNAME chain to Vault
const resp = await fetch(origin.invalidationWebhookUrl, {
method: 'POST',
redirect: 'follow',
body: JSON.stringify({ skillId, releaseId }),
headers: { 'Content-Type': 'application/json' },
});
const confirmation = await resp.json();
return confirmation; // VULNERABLE: Vault KV data returned to caller
}
// SSRF69-003 — FIXED
async function sendCdnInvalidation(skillId, releaseId) {
const origin = await db.cdnOrigins.findOne({ skillId });
if (!origin) return;
const parsed = new URL(origin.invalidationWebhookUrl);
if (!CDN_ORIGIN_ALLOWLIST.has(parsed.hostname)) return;
// FIXED: redirect:error prevents CNAME-based rebinding to internal services
await fetch(origin.invalidationWebhookUrl, {
method: 'POST',
redirect: 'error',
body: JSON.stringify({ skillId, releaseId }),
headers: { 'Content-Type': 'application/json' },
});
// FIXED: fire-and-forget — never read or return response body
}
SSRF69-004 — Distribution audit sink stores etcd config as persistent audit record
The distribution audit sink registration endpoint allows skill owners to register an external URL to receive distribution audit events. When an event fires, the registry performs a health check by fetching the sink URL and storing the raw response as a distribution audit record. An attacker registers a sink URL pointing to the internal etcd REST API at http://etcd:2379/v3/kv/range. The registry stores the full etcd key-value store range response as the audit record. The etcd configuration — including cluster join tokens, TLS configuration, and service credentials — is subsequently readable by any user with access to the distribution audit history API endpoint.
// SSRF69-004 — VULNERABLE
router.post('/audit-sinks',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const { auditSinkUrl } = req.body;
// VULNERABLE: fetches user-supplied URL and stores raw response as audit record
const healthCheck = await fetch(auditSinkUrl);
const body = await healthCheck.text();
await db.distributionAuditRecords.create({
skillId: req.params.id,
sinkUrl: auditSinkUrl,
healthCheckResponse: body, // VULNERABLE: etcd config stored persistently
});
res.json({ ok: true });
}
);
// SSRF69-004 — FIXED
router.post('/audit-sinks',
requireSession,
requireOwnership('skillId'),
async (req, res) => {
const { auditSinkUrl } = req.body;
if (isPrivateIp(auditSinkUrl)) {
return res.status(422).json({ error: 'Private IP ranges not permitted' });
}
// FIXED: HEAD request only — never read response body
const healthCheck = await fetch(auditSinkUrl, { method: 'HEAD', redirect: 'error' });
await db.distributionAuditRecords.create({
skillId: req.params.id,
sinkUrl: auditSinkUrl,
// FIXED: boolean only — never store raw response body
healthCheckOk: healthCheck.ok,
});
res.json({ ok: true });
}
);
SkillAudit detection: The scanner identifies SSRF69 patterns using four AST query classes: fetch(req.body. or fetch(req.query. without a preceding private-IP guard; redirect: 'follow' on fetches that use user-supplied URLs; response body proxied directly to res.json(); and db. create calls where the stored field is derived from a fetched response body. Submit your MCP skill registry codebase to SkillAudit for a full audit report.