← Security advisories

Claude MCP skill SSRF — skill documentation and README fetch endpoints — SA-SKL-SSRF42

SA-SKL-SSRF42 documents four SSRF vulnerabilities in MCP skill registry skill documentation and README fetch endpoints. Documentation and README fetch endpoints are SSRF-prone by design: their entire purpose is to retrieve content from external URLs supplied by skill authors. The challenge is scoping what "external" means without blocking legitimate documentation hosts while preventing access to metadata services, internal infrastructure, and secret stores. All four SSRF42 patterns result from incomplete hostname allowlists or missing redirect controls.

SA-SKL-SSRF42 findings at a glance
CRITICALSSRF42-001 — Documentation fetch endpoint fetches user-supplied docsUrl; attacker sets to 169.254.169.254; IAM credentials returned as documentation content displayed to all registry users
HIGHSSRF42-002 — README image embed fetches user-supplied imageUrl; attacker points to Prometheus:9090; Prometheus metric JSON served as badge image bytes
HIGHSSRF42-003 — External link verification fetches user-supplied linkUrl with redirect:follow; attacker points to Vault via CNAME; KV secrets returned as link validation result
MEDIUMSSRF42-004 — OpenAPI spec fetch fetches user-supplied specUrl; attacker points to etcd:2379; etcd response stored as API spec and returned to all registry users

SSRF42-001 — Documentation fetch leaks IAM credentials via metadata service

The documentation fetch endpoint accepts a docsUrl parameter and fetches its content server-side to render it in the registry's skill documentation tab. When a skill author sets docsUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/, the registry server — running on a cloud instance with an attached IAM role — receives the metadata service's credential response and stores it in the skill's docsContent field, where it is rendered as markdown for all registry users to read.

SSRF42-001 fix: Implement a hostname allowlist that permits only known documentation hosting domains: raw.githubusercontent.com, api.github.com, docs.skillaudit.dev, and explicitly registered custom documentation hosts. Resolve all hostnames to IP addresses before the fetch and reject requests to RFC 1918 addresses (10.x, 172.16-31.x, 192.168.x), loopback (127.x), link-local (169.254.x), and IPv6 equivalents. Set redirect: 'error' to prevent redirects to metadata services. Return only CommonMark-parsed text — never return raw HTTP response bytes.

WRONG
app.post('/skills/:id/docs', async (req, res) => {
  const response = await fetch(req.body.docsUrl);
  const content = await response.text();
  await db.update('skills', { docsContent: content }, { id: req.params.id });
  res.json({ ok: true });
});

RIGHT
const DOCS_ALLOWLIST = new Set(['raw.githubusercontent.com', 'api.github.com', 'docs.skillaudit.dev']);

app.post('/skills/:id/docs', requireSession, async (req, res) => {
  const url = new URL(req.body.docsUrl);
  if (!DOCS_ALLOWLIST.has(url.hostname)) return res.status(400).json({ error: 'hostname not allowed' });

  const resolved = await dns.resolve4(url.hostname);
  if (resolved.some(isPrivateIP)) return res.status(400).json({ error: 'private IP blocked' });

  const response = await fetch(req.body.docsUrl, { redirect: 'error', size: 512 * 1024 });
  const markdown = parseCommonMark(await response.text()); // parse only, never return raw
  await db.update('skills', { docsContent: markdown }, { id: req.params.id });
  res.json({ ok: true });
});

SSRF42-002 — README image embed fetches internal metrics endpoint

The README image embed endpoint fetches imageUrl values to proxy skill badge images and inline README illustrations. Without a hostname allowlist, an attacker who sets imageUrl to http://prometheus-server:9090/metrics receives Prometheus plaintext metric output, which the server faithfully passes through as image bytes with whatever Content-Type the target returns. The attacker can read these "image" bytes from the registry API response, extracting counter names, gauge values, and label sets that map the internal monitoring infrastructure.

WRONG
app.get('/skills/:id/readme-image', async (req, res) => {
  const response = await fetch(req.query.imageUrl, { redirect: 'follow' });
  res.set('Content-Type', response.headers.get('content-type'));
  response.body.pipe(res);
});

RIGHT
const IMAGE_CDN_ALLOWLIST = new Set(['img.shields.io', 'badges.skillaudit.dev', 'raw.githubusercontent.com']);

app.get('/skills/:id/readme-image', async (req, res) => {
  const url = new URL(req.query.imageUrl);
  if (!IMAGE_CDN_ALLOWLIST.has(url.hostname)) return res.status(400).end();

  const response = await fetch(req.query.imageUrl, { redirect: 'error', size: 2 * 1024 * 1024 });
  const contentType = response.headers.get('content-type') || '';
  if (!contentType.startsWith('image/')) return res.status(400).end();

  res.set('Content-Type', contentType);
  res.set('Content-Security-Policy', "default-src 'none'");
  response.body.pipe(res);
});

SSRF42-003 — External link verification follows CNAME to Vault

The external link verification endpoint checks whether links embedded in skill documentation are reachable. It follows redirects (redirect: 'follow') and returns the response body as evidence of link validity. An attacker registers a CNAME at docs.attacker.com pointing to vault.internal:8200 and sets a documentation link to that CNAME. The link verifier resolves the CNAME and fetches the Vault health endpoint, then stores the JSON response body — containing Vault cluster state and enabled secret engine names — as the link verification result.

SSRF42-003 fix: Set redirect: 'error' — link verification does not need to follow redirects; a redirect is itself a valid signal about link status. After DNS resolution, block requests to private IP ranges. Return only the HTTP status code and timestamp as the verification result, never the response body.

SSRF42-004 — OpenAPI spec fetch targets etcd

The OpenAPI spec fetch endpoint allows skill authors to link to an external OpenAPI specification that describes the skill's tool interface. The server fetches the spec, validates it, and stores it in the registry for display to consumers. When a skill author sets specUrl to http://etcd-server:2379/v2/keys/?recursive=true, the etcd HTTP API returns a JSON tree of all stored keys and values — including service discovery records, feature flag values, and any secrets stored directly in etcd. The server attempts to parse this as an OpenAPI document, fails validation, and returns the raw etcd response body in the validation error message.

WRONG
app.post('/skills/:id/openapi-spec', async (req, res) => {
  const response = await fetch(req.body.specUrl);
  const spec = await response.json();
  try {
    OpenAPISchema.parse(spec);
  } catch (e) {
    return res.status(400).json({ error: e.message, received: spec }); // leaks etcd response
  }
  await db.update('skills', { openapiSpec: spec }, { id: req.params.id });
  res.json({ ok: true });
});

RIGHT
const SPEC_HOSTING_ALLOWLIST = new Set(['api.github.com', 'raw.githubusercontent.com',
  'petstore.swagger.io', 'editor.swagger.io']);

app.post('/skills/:id/openapi-spec', requireSession, async (req, res) => {
  const url = new URL(req.body.specUrl);
  if (!SPEC_HOSTING_ALLOWLIST.has(url.hostname)) return res.status(400).json({ error: 'hostname not allowed' });

  const resolved = await dns.resolve4(url.hostname);
  if (resolved.some(isPrivateIP)) return res.status(400).json({ error: 'private IP blocked' });

  const response = await fetch(req.body.specUrl, { redirect: 'error', size: 1024 * 1024 });
  try {
    const spec = OpenAPISchema.parse(await response.json());
    await db.update('skills', { openapiSpec: spec }, { id: req.params.id });
    res.json({ ok: true });
  } catch {
    return res.status(400).json({ error: 'invalid OpenAPI spec' }); // never return raw body
  }
});
Detect SA-SKL-SSRF42 in your registry

SkillAudit scans for missing hostname allowlists, unblocked private IP ranges, redirect:follow on fetch calls, and raw response body returns in all documentation and media fetch endpoints.

Scan your registry
FindingSeverityEndpointTarget / Impact
SSRF42-001CRITICALPOST /skills/:id/docs — docsUrl169.254.169.254 → IAM credentials displayed to all users
SSRF42-002HIGHGET /skills/:id/readme-image — imageUrlPrometheus:9090 → internal metrics exposed as image bytes
SSRF42-003HIGHPOST /skills/:id/links/verify — linkUrlCNAME → Vault:8200 → KV secrets in link verification result
SSRF42-004MEDIUMPOST /skills/:id/openapi-spec — specUrletcd:2379 → all etcd keys returned in validation error

See also: SA-SKL-SSRF41 (static analysis tool integration SSRF patterns) and SA-SKL-DESER25 (CI/CD pipeline deserialization that can be triggered via SSRF-written pipeline configs).