Claude MCP skill SSRF — skill package registry proxy and npm mirror endpoints — SA-SKL-SSRF43
SA-SKL-SSRF43 documents four server-side request forgery vulnerabilities in MCP skill registry package proxy and npm mirror endpoints. Package proxy infrastructure necessarily makes outbound HTTP requests to external registries on behalf of users — but when the target URL is user-controlled, the proxy becomes a request forwarder to any internal service. Each vulnerability in this advisory targets a distinct part of the package proxy surface: the registry proxy itself, the npm mirror sync endpoint, the package integrity checker, and the provenance attestation fetcher. The targets they can reach — the cloud IMDS, Consul, Vault, and etcd — represent the core of a typical MCP registry's infrastructure credential and configuration plane.
registryUrl; attacker sets to 169.254.169.254; cloud IMDS IAM credentials returned as package metadata and stored in registrymirrorUrl; attacker points to Consul:8500; Consul /v1/catalog/services JSON returned as package list exposing internal service topologychecksumUrl with redirect:follow; attacker controls CNAME pointing to Vault:8200; Vault KV secrets returned as checksum valuesigstoreUrl; attacker points to etcd:2379; etcd key-value response stored as attestation record visible to all registry usersSSRF43-001 — Package registry proxy SSRF leaks IAM credentials via IMDS
The package registry proxy endpoint accepts a registryUrl parameter that specifies which upstream package registry to proxy requests to. When the registry makes an outbound HTTP request to this URL to fetch package metadata, an attacker who sets registryUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/ receives the cloud provider's instance metadata service (IMDS) response. On AWS, this returns the name of the attached IAM role; a second request to the named credential endpoint returns the full AccessKeyId, SecretAccessKey, and Token. These credentials are then stored as the fetched "package metadata" and may be returned to the requesting user or logged in the registry's audit trail.
IMDS credential exfiltration is the most direct path from SSRF to full infrastructure compromise. The IAM role attached to the registry worker typically has permissions to read secrets from Secrets Manager, write to S3 buckets containing skill packages, and assume other roles. With IMDS credentials in hand, an attacker has the same infrastructure access as the registry itself.
SSRF43-001 fix: Implement a strict hostname allowlist: only registry.npmjs.org, npm.pkg.github.com, and any other explicitly approved public registries. Resolve the hostname to an IP address before making the request and reject RFC 1918, loopback, link-local, and IMDS ranges (169.254.0.0/16). Set redirect: 'error' to prevent redirect chains that bypass DNS-based filtering. Never return the raw upstream response body — parse only the expected package manifest fields via Zod before returning.
// WRONG — user-supplied registryUrl fetched without validation
const pkgMeta = await fetch(`${req.body.registryUrl}/${packageName}`);
res.json(await pkgMeta.json()); // returns full IMDS response if URL = 169.254.169.254
// RIGHT — allowlist + DNS IP check + response schema
const ALLOWED_REGISTRIES = new Set(['registry.npmjs.org', 'npm.pkg.github.com']);
const url = new URL(req.body.registryUrl);
if (!ALLOWED_REGISTRIES.has(url.hostname)) throw new ForbiddenError('Registry not in allowlist');
const resolved = await dns.promises.lookup(url.hostname, { family: 4 });
if (isPrivateIP(resolved.address)) throw new ForbiddenError('Private IP range rejected');
const resp = await fetch(url.toString(), { redirect: 'error' });
const raw = await resp.json();
const meta = PackageManifestSchema.parse(raw); // name, version, description only
res.json(meta);
SSRF43-002 — npm mirror sync SSRF exposes internal service topology via Consul
The npm mirror sync endpoint accepts a mirrorUrl parameter that specifies the upstream npm mirror to sync from. When the registry fetches the package list from this URL, an attacker who points it to http://consul.internal:8500/v1/catalog/services receives the full Consul service catalog: a JSON object mapping every internal service name to its registered health check tags. This reveals the complete internal service topology — every microservice name, its health check URL patterns, and the tags that encode environment and version information. This topology is not secret in a strict cryptographic sense, but it dramatically accelerates lateral movement by giving an attacker a map of every internal service they could target.
SSRF43-002 fix: Implement an npm mirror hostname allowlist. Set redirect: 'error'. Parse the response with a Zod schema that extracts only name, version, and description from the package list — never return or store the raw response body. Pre-register allowed mirror URLs per organization and store them server-side; never accept a mirror URL as a request-time parameter.
SSRF43-003 — Package integrity check SSRF via redirect:follow reaches Vault
The package integrity check endpoint fetches a user-supplied checksumUrl to retrieve the expected SHA-256 or SHA-512 checksum for a package archive. The endpoint uses redirect: 'follow' (the default for the node-fetch library). An attacker registers a domain with a CNAME record pointing to the internal Vault server address. When the registry follows the CNAME redirect, it reaches http://vault.internal:8200/v1/secret/data/signing-keys and stores the Vault KV response as the "checksum value" for the package. The checksum validation then fails (the returned string is not a valid hex digest), but the response body is logged in the validation error message, exposing the Vault secret content.
SSRF43-004 fix: Set redirect: 'error' in all fetch calls that retrieve external checksums. After following the allowlist and DNS IP check, re-validate the final destination IP after any redirect. Extract only a hex string from the response body — apply a regex /^[a-f0-9]{64}(:[a-f0-9]{128})?$/i and reject anything that does not match. Never log the raw response body in error messages.
SSRF43-004 — Provenance attestation SSRF leaks etcd secrets
The provenance attestation endpoint fetches a user-supplied sigstoreUrl to retrieve a Sigstore bundle for a package artifact. If the URL points to http://etcd.internal:2379/v3/kv/range, the etcd gRPC-gateway endpoint returns a JSON response containing the base64-encoded values of whatever key range is queried. This response is then stored as the attestation record for the package and may be returned to any registry user who queries the package's provenance. etcd stores Kubernetes secrets, service account tokens, and infrastructure configuration — all of which become readable by any registry user who can view package provenance data.
SSRF43-004 fix: Implement a Sigstore-specific hostname allowlist: rekor.sigstore.dev, fulcio.sigstore.dev, and other known Sigstore transparency log endpoints. Reject all other URLs. Parse the response with a strict Zod DSSEBundleSchema that extracts only the bundle envelope and verification status. Never store or return the raw HTTP response body. Store allowed Sigstore URLs per skill in the database rather than accepting them as request parameters.
SkillAudit scans for missing URL allowlists, absent DNS private-IP rejection, redirect:follow on external fetch calls, and unfiltered response body forwarding across all package proxy endpoints in your MCP skill registry codebase.
| Finding | Severity | Endpoint | SSRF target / Impact |
|---|---|---|---|
| SSRF43-001 | CRITICAL | Package registry proxy (registryUrl) | Cloud IMDS 169.254.169.254 → IAM credential exfiltration |
| SSRF43-002 | HIGH | npm mirror sync (mirrorUrl) | Consul :8500 → internal service topology disclosure |
| SSRF43-003 | HIGH | Package integrity check (checksumUrl) | Vault :8200 via CNAME redirect → KV secret exfiltration |
| SSRF43-004 | MEDIUM | Provenance attestation (sigstoreUrl) | etcd :2379 → Kubernetes secrets stored as attestation record |
See also: SA-SKL-SSRF42 (documentation and README fetch SSRF patterns) and SA-SKL-SSRF41 (static analysis tool integration SSRF) for the complete SSRF attack surface across MCP skill registry outbound-fetch infrastructure.