← Blog

Claude MCP skill SSRF — documentation fetch and external resource preview — SA-SKL-SSRF25

Documentation preview and external URL rendering are convenience features that skill registries add to improve developer experience. When these features make server-side HTTP requests to developer-supplied URLs without an SSRF guard, they become a reliable path to internal service enumeration and cloud credential theft. SA-SKL-SSRF25 covers four SSRF patterns that emerge from documentation URL fetching, OpenGraph preview generation, custom domain verification, and changelog auto-import in MCP skill registries.

By SkillAudit  |  13 Nov 2026
SA-SKL-SSRF25 findings at a glance
CRITICALSSRF25-001 — Documentation URL field (skill.docsUrl) is fetched server-side to generate a preview card when the skill is listed; no SSRF guard is applied; attacker sets docsUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-role and the response body (IAM temporary credentials) is stored in the preview cache and returned to any visitor of the skill listing page
HIGHSSRF25-002 — OpenGraph metadata is fetched from the skill's homepage URL to generate a social preview without DNS IP validation; attacker sets homepage to http://10.0.0.1:9200/_cat/indices?v (internal Elasticsearch); the fetched response body is stored in the registry DB as the OpenGraph description and returned to all users viewing the skill
HIGHSSRF25-003 — Custom domain verification issues a DNS TXT record lookup for a user-supplied domain; the DNS resolver URL is constructed as https://dns.google/resolve?name=${domain}&type=TXT; attacker registers a domain with a DNS record that points to 10.0.0.1 with TTL=0; during the verification window, the resolver returns the internal IP; the registry then fetches the verification token from http://10.0.0.1/.well-known/acme-challenge/token — SSRF via DNS rebinding
HIGHSSRF25-004 — Skill changelog is auto-fetched from the changelog field in the published package.json; no SSRF guard; attacker publishes a package with "changelog": "http://internal-grafana:3000/api/dashboards/home"; the registry fetches and stores the response as the changelog content, potentially exposing internal dashboard JSON to all skill page visitors

Background: server-side URL fetching in skill registries

Skill registries fetch content from developer-supplied URLs for three main purposes: enriching listings with preview data (documentation, OpenGraph), verifying ownership of external resources (custom domains), and importing structured content from canonical sources (changelogs, READMEs). Each of these use cases involves the registry's backend making an HTTP request to a URL that an attacker controls. Without a consistent SSRF prevention strategy applied at every fetch point, any one of these endpoints becomes a probe into the registry's internal network.

The findings in SA-SKL-SSRF25 build on the SSRF patterns in SA-SKL-SSRF24 (CI audit triggers) and SA-SKL-SSRF23 (npm registry proxy). SSRF25-003 is a DNS rebinding variant that requires the attacker to control the DNS record for a domain they own, making it harder to block with simple IP blocklists — a TTL-0 record can point to an internal IP during the verification window even after passing an initial DNS check.

SSRF25-001 — CRITICAL — Documentation URL fetched server-side without SSRF guard

When a skill is published, the registry fetches the docsUrl field server-side to generate a documentation preview card. The fetch result is parsed for title and description metadata and stored in the registry database. The endpoint imposes no restrictions on the target URL beyond a basic URL syntax check. An attacker sets docsUrl to the EC2 instance metadata endpoint. The response body — which contains the IAM role name and temporary credentials for the registry's cloud role — is stored in the preview cache. Any visitor who views the skill listing receives this data in the preview metadata. The attacker can harvest the temporary credentials before they expire (typically 6 hours) and use them to access the registry's S3 buckets, DynamoDB tables, and other AWS services.

The fix requires an SSRF prevention guard applied to every server-side HTTP fetch of a developer-supplied URL. The guard must: (1) resolve the hostname to its IP address(es) before making the request; (2) block requests to RFC1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback (127.0.0.0/8), link-local (169.254.0.0/16), and other non-routable ranges; (3) use redirect: 'error' or re-validate the resolved IP on each redirect to prevent DNS rebinding; (4) enforce HTTPS-only for all external URL fetches.

Vulnerable
// VULNERABLE — SSRF25-001
// services/docs-preview.js

async function fetchDocsPreview(docsUrl) {
  // BUG: no SSRF guard — any URL including 169.254.169.254 is fetched
  try {
    new URL(docsUrl);  // only checks URL syntax — does not validate target IP
  } catch {
    throw new Error('Invalid URL');
  }

  const res = await fetch(docsUrl, {
    headers: { 'User-Agent': 'SkillAudit-Preview/1.0' },
    signal: AbortSignal.timeout(5000),
  });

  const html = await res.text();
  return extractMetaTags(html);  // attacker response stored in DB as preview
}
Fixed
// FIXED — SSRF25-001
// utils/ssrf-guard.js

const { Resolver } = require('dns').promises;
const ipRangeCheck = require('ip-range-check');

const BLOCKED_RANGES = [
  '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16',  // RFC1918
  '127.0.0.0/8',       // loopback
  '169.254.0.0/16',    // link-local / IMDS
  '100.64.0.0/10',     // shared address space
  '::1/128',           // IPv6 loopback
  'fc00::/7',          // IPv6 unique local
  'fe80::/10',         // IPv6 link-local
];

async function validateSsrfSafe(urlStr) {
  const url = new URL(urlStr);

  if (!['https:'].includes(url.protocol)) {
    throw new Error('SSRF guard: only HTTPS URLs are permitted');
  }

  const resolver = new Resolver();
  const addresses = await resolver.resolve4(url.hostname).catch(() => []);
  const addresses6 = await resolver.resolve6(url.hostname).catch(() => []);
  const allAddresses = [...addresses, ...addresses6];

  if (allAddresses.length === 0) {
    throw new Error('SSRF guard: hostname does not resolve');
  }

  for (const ip of allAddresses) {
    if (ipRangeCheck(ip, BLOCKED_RANGES)) {
      throw new Error(`SSRF guard: resolved IP ${ip} is in a blocked range`);
    }
  }
}

// services/docs-preview.js
async function fetchDocsPreview(docsUrl) {
  await validateSsrfSafe(docsUrl);  // throws if internal/private URL

  const res = await fetch(docsUrl, {
    redirect: 'error',  // no redirects — DNS rebinding prevention
    headers: { 'User-Agent': 'SkillAudit-Preview/1.0' },
    signal: AbortSignal.timeout(5000),
  });

  const html = await res.text();
  return extractMetaTags(html);
}

SSRF25-001 impact: On AWS-hosted registries, the attack recovers temporary IAM credentials in a single publish request. The credentials have the permissions of the registry's EC2 or ECS role, which commonly includes S3 read/write, DynamoDB access, and Secrets Manager read. SkillAudit detects this by submitting a skill with docsUrl set to a canary HTTP endpoint under attacker control and verifying whether a request arrives from the registry's IP range.

SSRF25-002 — HIGH — OpenGraph preview fetch without DNS IP validation

The registry generates social preview cards by fetching the og:title, og:description, and og:image tags from the skill's homepage URL. The fetcher validates that the URL uses HTTP or HTTPS but does not resolve the hostname to an IP address before fetching. An attacker sets homepage to an internal service URL — Elasticsearch on 10.0.0.1:9200, internal Redis on 10.0.0.2:6379, or the Kubernetes API on 10.96.0.1:443. The registry fetches the response, fails to find OpenGraph tags, and stores the raw response text in the description field. This raw text is returned to all users who view the skill listing, exposing internal service responses publicly.

The same SSRF guard from SSRF25-001 applies here. Additionally, the OpenGraph fetcher should impose a maximum response body size (e.g., 512 KB) to prevent memory exhaustion from internal services returning large responses, and should time out aggressively (1–2 seconds) to avoid holding connections open to slow internal services.

Vulnerable
// VULNERABLE — SSRF25-002
// services/og-preview.js

async function fetchOpenGraph(homepageUrl) {
  // BUG: only protocol check — no DNS resolution or IP blocklist
  const url = new URL(homepageUrl);
  if (!['http:', 'https:'].includes(url.protocol)) {
    throw new Error('Invalid protocol');
  }

  // attacker sets homepageUrl to http://10.0.0.1:9200/_cat/indices?v
  const res = await fetch(homepageUrl, { signal: AbortSignal.timeout(10000) });
  const html = await res.text();

  // stores Elasticsearch index list in description field
  return {
    title: extractOgTag(html, 'og:title') || homepageUrl,
    description: extractOgTag(html, 'og:description') || html.slice(0, 300),
  };
}
Fixed
// FIXED — SSRF25-002
// services/og-preview.js
const { validateSsrfSafe } = require('../utils/ssrf-guard');  // from SSRF25-001 fix

const MAX_BODY_BYTES = 512 * 1024;  // 512 KB

async function fetchOpenGraph(homepageUrl) {
  await validateSsrfSafe(homepageUrl);  // DNS resolution + RFC1918 block

  const res = await fetch(homepageUrl, {
    redirect: 'error',
    signal: AbortSignal.timeout(2000),  // aggressive timeout
    headers: { 'User-Agent': 'SkillAudit-OGPreview/1.0' },
  });

  // Limit response body to prevent memory exhaustion
  const reader = res.body.getReader();
  let bytes = 0;
  const chunks = [];
  while (true) {
    const { done, value } = await reader.read();
    if (done) break;
    bytes += value.length;
    if (bytes > MAX_BODY_BYTES) break;  // truncate — still safe, OG tags are near top
    chunks.push(value);
  }
  const html = Buffer.concat(chunks).toString('utf8');

  return {
    title: extractOgTag(html, 'og:title') || '',
    description: extractOgTag(html, 'og:description') || '',
  };
}

SSRF25-002 impact: Internal service responses (Elasticsearch index lists, Redis INFO output, k8s API server responses) are stored in the registry DB and returned to all users viewing the skill. Elasticsearch responses can include index names, document counts, and cluster health data. Combined with the lack of body size limits, an attacker pointing to a service that streams a continuous response (like a Redis SUBSCRIBE command) can hold a connection open and cause resource exhaustion on the preview fetcher.

SSRF25-003 — HIGH — DNS rebinding via custom domain verification

The custom domain verification flow asks users to add a DNS TXT record to their domain and then calls a verification endpoint. The registry verifies the domain by fetching http://${domain}/.well-known/skillaudit-verify/${token}. The attacker registers a domain (e.g., evil.example.com) under their control. They configure its DNS with TTL=0 and a TXT record containing the verification token. When the registry performs the initial DNS lookup to verify the TXT record, the domain resolves to the attacker's public IP. The attacker then changes the DNS A record to 10.0.0.5 (an internal Redis server) with TTL=0. The registry's HTTP fetch for the well-known path uses the now-updated DNS resolution (because TTL=0 bypasses the system resolver cache) and reaches the internal Redis server. Any HTTP response from Redis is accepted as the verification response.

DNS rebinding is defeated by pinning the IP address at resolution time and using it directly for the HTTP fetch, bypassing DNS on the subsequent connection. After resolving the hostname to an IP, pass the resolved IP to the HTTP client directly (via the Host header with the original hostname) rather than allowing the HTTP client to perform a second DNS resolution. This ensures that even if the DNS record changes between the check and the fetch, the connection goes to the originally resolved IP.

Vulnerable
// VULNERABLE — SSRF25-003
// services/domain-verification.js

async function verifyDomain(domain, token) {
  // Step 1: check DNS TXT record (resolves attacker domain → public IP)
  const resolver = new Resolver();
  const txtRecords = await resolver.resolveTxt(domain);
  const hasToken = txtRecords.flat().some(r => r === `skillaudit-verify=${token}`);
  if (!hasToken) throw new Error('TXT record not found');

  // Step 2: fetch well-known path — BUG: DNS resolved again here (TTL=0 bypass)
  // attacker changes DNS to 10.0.0.5 between step 1 and step 2
  const res = await fetch(`http://${domain}/.well-known/skillaudit-verify/${token}`, {
    signal: AbortSignal.timeout(5000),
  });

  return res.ok;
}
Fixed
// FIXED — SSRF25-003
// services/domain-verification.js
const { validateSsrfSafe } = require('../utils/ssrf-guard');
const net = require('net');

async function verifyDomain(domain, token) {
  // Validate domain is a plain hostname — no IP literals, no CNAME to private ranges
  if (net.isIP(domain)) {
    throw new Error('Domain must be a hostname, not an IP literal');
  }

  // Check TXT record
  const resolver = new Resolver();
  const txtRecords = await resolver.resolveTxt(domain);
  const hasToken = txtRecords.flat().some(r => r === `skillaudit-verify=${token}`);
  if (!hasToken) throw new Error('TXT record not found');

  // PIN the IP at resolution time — pass to fetch via custom agent that bypasses DNS
  const addresses = await resolver.resolve4(domain);
  const ip = addresses[0];

  // Validate resolved IP is not internal
  const ipRangeCheck = require('ip-range-check');
  if (ipRangeCheck(ip, BLOCKED_RANGES)) {
    throw new Error(`SSRF guard: domain resolved to blocked IP ${ip}`);
  }

  // Fetch using pinned IP — custom dispatcher overrides DNS lookup
  const { Agent } = require('undici');
  const pinnedAgent = new Agent({
    connect: { lookup: (_hostname, _opts, cb) => cb(null, ip, 4) },
  });

  const res = await fetch(
    `https://${domain}/.well-known/skillaudit-verify/${token}`,
    {
      dispatcher: pinnedAgent,
      redirect: 'error',          // no redirects — prevents redirect to internal
      signal: AbortSignal.timeout(5000),
    }
  );

  return res.ok;
}

SSRF25-003 impact: DNS rebinding exploits the gap between the DNS check and the HTTP fetch. With TTL=0, an attacker can flip their DNS A record from a public IP to an internal IP within milliseconds. The race window exists in any two-step verify-then-fetch flow. Pinning the IP from the initial DNS resolution and passing it to the HTTP transport layer is the standard mitigation. SkillAudit detects domain verification flows that perform multiple DNS lookups for the same hostname by analyzing the number of resolve() calls for a given input across the verification function's AST.

SSRF25-004 — HIGH — Changelog auto-fetch from package.json field

The registry reads a changelog field from the published package.json and automatically fetches its contents to display in the skill's version history UI. This is a convenience feature that lets authors point to their existing CHANGELOG.md on GitHub. The fetch is performed server-side by the registry's package processor with no SSRF guard. An attacker publishes a package where "changelog": "http://internal-grafana:3000/api/dashboards/home". The registry's internal Grafana instance (on the internal Docker network) responds with dashboard JSON. This JSON is stored in the registry DB as the changelog content and displayed on the public skill listing page, exposing internal Grafana dashboard data.

The fix is to apply the same SSRF guard from SSRF25-001 to all developer-supplied URL fields that trigger server-side fetches, including changelog, homepage, repository.url, and any other URL fields in the package manifest. Additionally, consider restricting these fields to known-safe URL patterns using an allowlist (e.g., only GitHub, GitLab, Bitbucket URLs for changelog), which reduces the attack surface from an arbitrary URL to a small set of trusted hosts.

Vulnerable
// VULNERABLE — SSRF25-004
// services/package-processor.js

async function processPackageManifest(manifest) {
  const metadata = {
    name: manifest.name,
    version: manifest.version,
    description: manifest.description,
  };

  // BUG: changelog URL from package.json fetched without SSRF guard
  // attacker: { "changelog": "http://internal-grafana:3000/api/dashboards/home" }
  if (manifest.changelog) {
    try {
      const res = await fetch(manifest.changelog, {
        signal: AbortSignal.timeout(10000),
      });
      metadata.changelogContent = await res.text();  // internal Grafana JSON stored
    } catch (e) {
      metadata.changelogContent = '';
    }
  }

  return metadata;
}
Fixed
// FIXED — SSRF25-004
// services/package-processor.js
const { validateSsrfSafe } = require('../utils/ssrf-guard');

// Allowlist: changelog URLs must be on known source hosting platforms
const CHANGELOG_HOST_ALLOWLIST = new Set([
  'raw.githubusercontent.com',
  'raw.gitlab.com',
  'bitbucket.org',
  'gist.githubusercontent.com',
]);

async function processPackageManifest(manifest) {
  const metadata = {
    name: manifest.name,
    version: manifest.version,
    description: manifest.description,
  };

  if (manifest.changelog) {
    let changelogUrl;
    try {
      changelogUrl = new URL(manifest.changelog);
    } catch {
      // invalid URL — skip changelog fetch
      return metadata;
    }

    // Allowlist: only well-known source hosting platforms
    if (!CHANGELOG_HOST_ALLOWLIST.has(changelogUrl.hostname)) {
      // Log and skip — do not throw, do not expose error to attacker
      logger.warn({ changelog: manifest.changelog }, 'changelog URL host not in allowlist — skipping');
      return metadata;
    }

    // Apply SSRF guard as defense-in-depth even for allowlisted hosts
    await validateSsrfSafe(manifest.changelog);

    const res = await fetch(manifest.changelog, {
      redirect: 'error',
      signal: AbortSignal.timeout(5000),
    });
    if (res.ok) {
      const text = await res.text();
      metadata.changelogContent = text.slice(0, 100_000);  // size limit
    }
  }

  return metadata;
}

SSRF25-004 defense-in-depth: The hostname allowlist is the primary control here because it reduces the attack surface from any URL to a small set of trusted hosts. The SSRF IP-range check provides defense-in-depth in case a trusted host (e.g., raw.githubusercontent.com) is ever compromised or returns a redirect to an internal URL. The combination — allowlist + SSRF guard + redirect:error — provides three independent barriers. SkillAudit flags any server-side fetch of a URL read from a package manifest field that lacks both a hostname allowlist and an SSRF guard.

Detection with SkillAudit

SkillAudit's SSRF detection scans for all four SA-SKL-SSRF25 patterns. For SSRF25-001 and SSRF25-002, the scanner submits skills with URL fields pointing to a canary HTTP endpoint and verifies whether a request arrives from the registry's server IP. For SSRF25-003, the scanner detects multi-step domain verification flows where the DNS resolution and HTTP fetch are performed in separate calls to the same hostname string. For SSRF25-004, the scanner traces the data flow from package manifest URL fields to fetch() or HTTP client calls and flags any path that lacks both an allowlist check and DNS IP range validation.

FindingSeverityAttack targetFix
SSRF25-001CRITICALIMDS IAM credentials via docsUrl fetchSSRF guard: DNS resolve + RFC1918 block + HTTPS only
SSRF25-002HIGHInternal Elasticsearch via OpenGraph previewSSRF guard + body size limit + aggressive timeout
SSRF25-003HIGHInternal services via DNS rebinding on domain verifyPin IP from initial DNS resolution; use in HTTP transport
SSRF25-004HIGHInternal Grafana via changelog URL in package.jsonHostname allowlist + SSRF guard + redirect:error

Related findings: SA-SKL-SSRF24 (CI audit SSRF), SA-SKL-SSRF23 (npm registry proxy SSRF), SA-SKL-CORS23 (CORS on file download).