← Security advisories

Claude MCP skill SSRF — skill audit report export and download endpoints — SA-SKL-SSRF45

SA-SKL-SSRF45 documents four server-side request forgery vulnerabilities in MCP skill registry audit report export and download endpoints. Report generation is a natural SSRF target: it legitimately needs to fetch external assets (logos, templates, referenced resources), which creates pressure to allow flexible URL inputs. Each of the four findings exploits a different surface in the report lifecycle — logo embedding at PDF generation, external report proxying at download, template fetching at rendering, and share link verification at distribution. All four reach internal infrastructure not intended to be accessible from the public registry API.

SA-SKL-SSRF45 findings at a glance
CRITICALSSRF45-001 — reportLogoUrl fetched without allowlist during PDF export; attacker sets to 169.254.169.254; IAM credentials embedded as logo data in the generated PDF and returned to the requester
CRITICALSSRF45-002 — externalReportUrl proxied without allowlist at report download endpoint; attacker points to Consul:8500; Consul catalog JSON returned as PDF download response body
CRITICALSSRF45-003 — templateUrl fetched with redirect:follow; attacker plants CNAME to vault.internal; Vault KV secrets returned as report template content and rendered into the generated report
HIGHSSRF45-004 — shareUrl fetched during share link verification; attacker points to etcd:2379; etcd cluster data stored as share verification result and returned in API response

SSRF45-001 — reportLogoUrl SSRF embeds IAM credentials in generated PDF

The audit report PDF export endpoint accepts a reportLogoUrl parameter that specifies the organization's logo to embed in the generated report header. The PDF generation library fetches this URL server-side and embeds the response as an image. With no allowlist or IP-range blocking, an attacker sets reportLogoUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/. The metadata service returns the list of IAM roles attached to the EC2 instance. A second request to the role-specific endpoint returns the full temporary credentials including AccessKeyId, SecretAccessKey, and Token.

These credentials are embedded as the "logo" in the generated PDF. The attacker requests the PDF export and receives the IAM credentials in the PDF binary. The IAM role attached to the registry instance typically holds S3 write permissions (for storing audit artifacts), DynamoDB permissions (for audit history), and potentially ECR permissions (for pulling audit engine containers). Any of these allow the attacker to pivot into the broader AWS environment beyond the registry itself.

SSRF45-001 fix: Allowlist reportLogoUrl to assets.skillaudit.dev and raw.githubusercontent.com. Block DNS resolution to private IP ranges (RFC 1918 + link-local 169.254.0.0/16) using a DNS-resolving allowlist check. Set redirect: 'error'. For org logos, require pre-upload to a signed URL endpoint and use only the resulting signed path — never accept arbitrary external URLs.

WRONG
async function exportReportPdf(reportId, options) {
  const logoData = await fetch(options.reportLogoUrl).then(r => r.arrayBuffer());
  // logoData may contain IAM credentials from 169.254.169.254
  return generatePdf(report, { logoData });
}
RIGHT
const LOGO_ALLOWLIST = /^https:\/\/(assets\.skillaudit\.dev|raw\.githubusercontent\.com)\//;

async function exportReportPdf(reportId, options) {
  if (!LOGO_ALLOWLIST.test(options.reportLogoUrl)) {
    throw new Error('reportLogoUrl must be a pre-uploaded asset URL');
  }
  const resolved = await dns.resolve4(new URL(options.reportLogoUrl).hostname);
  if (resolved.some(isPrivateIP)) throw new Error('reportLogoUrl resolves to private IP');
  const logoData = await fetch(options.reportLogoUrl, { redirect: 'error' }).then(r => r.arrayBuffer());
  return generatePdf(report, { logoData });
}

SSRF45-002 — externalReportUrl proxy returns Consul catalog as PDF download

The report download endpoint supports fetching an externally-hosted report via externalReportUrl and proxying its content to the requesting client. This feature exists to support report delivery from an organization's own storage without requiring the registry to store the report permanently. The endpoint proxies the response body directly to the client with Content-Type: application/pdf. With no allowlist, an attacker sets externalReportUrl to http://consul.internal:8500/v1/catalog/services. The Consul HTTP API returns JSON listing all registered internal services. The download endpoint proxies this JSON to the attacker as the PDF response body, revealing the full internal service topology.

SSRF45-002 fix: Allowlist externalReportUrl to known report hosting domains (organization-specific S3 bucket prefixes, CDN endpoints). Parse only report metadata from the response — never proxy raw response bodies. Block private IP DNS resolution. Consider replacing URL-based report delivery with a push-upload model where organizations upload reports to a signed registry endpoint.

// WRONG — proxies any URL response body as PDF download
router.get('/reports/:id/download', async (req, res) => {
  const report = await db.getReport(req.params.id);
  const upstream = await fetch(report.externalReportUrl);
  res.setHeader('Content-Type', 'application/pdf');
  upstream.body.pipe(res); // pipes Consul/etcd/metadata responses directly to attacker
});

// RIGHT — allowlist + DNS check + metadata-only parsing + no body proxy
router.get('/reports/:id/download', requireSession, async (req, res) => {
  const report = await db.getReport(req.params.id);
  if (!isAllowedReportHost(report.externalReportUrl)) {
    return res.status(400).json({ error: 'report URL not from an allowed host' });
  }
  const resolved = await dns.resolve4(new URL(report.externalReportUrl).hostname);
  if (resolved.some(isPrivateIP)) return res.status(400).json({ error: 'forbidden' });

  // redirect client to signed URL — never proxy body server-side
  const signedUrl = await generateSignedRedirect(report.externalReportUrl);
  res.redirect(302, signedUrl);
});

SSRF45-003 — templateUrl CNAME chain to Vault returns KV secrets as report template

The report template fetch endpoint allows organizations to supply a templateUrl for custom report branding. The endpoint fetches the URL with redirect: 'follow' (the default Node.js fetch behavior). An attacker registers a domain they control and sets its CNAME to vault.internal. When the registry server resolves the attacker's domain, the CNAME chain leads to the internal Vault server. With redirect: 'follow', the HTTP client follows any redirects including those that change the destination hostname. If the Vault server returns a Vault KV response body (a JSON object containing database credentials, API keys, or other secrets), that response is used as the report template and later rendered into the generated report or stored in the template cache — where the attacker can retrieve it.

SSRF45-003 fix: Set redirect: 'error' to prevent redirect-based SSRF. Resolve the hostname to an IP address before fetching and block private IP ranges. Allowlist templateUrl to known template CDN prefixes. After fetching, extract only valid HTML/CSS from the response using a strict parser — reject any response that is not content-type text/html or text/css within size limits. Sandbox template rendering to prevent exfiltration of fetched data.

SSRF45-004 — shareUrl verification fetches etcd cluster data as share metadata

The report share link verification endpoint validates that a share link is still active by fetching the shareUrl and checking the response. The intent is to verify that an external share link has not expired or been revoked. With no allowlist or IP restriction, an attacker constructs a share link with shareUrl set to http://etcd.internal:2379/v2/keys/. The etcd HTTP API returns the full key-value listing of the etcd cluster, which in a Kubernetes environment typically includes service account tokens, cluster certificates, and configuration secrets. The endpoint stores the raw response as the share verification result and returns it in the API response body, providing a clean read path for internal infrastructure data.

SSRF45-004 fix: Allowlist shareUrl to known share hosting domains. Resolve hostname and block private IP ranges. Return only a boolean valid status and expiresAt timestamp — never store or return the raw response body from the verification fetch. Add a maximum response size limit to prevent memory exhaustion on large internal API responses.

// WRONG — fetches any shareUrl and returns raw response body
router.get('/reports/:id/verify-share', async (req, res) => {
  const result = await fetch(req.query.shareUrl);
  const data = await result.json(); // may contain etcd cluster data
  await db.saveShareVerification(req.params.id, data); // stores etcd data
  res.json(data); // returns etcd data to attacker
});

// RIGHT — allowlist + DNS check + boolean-only response
router.get('/reports/:id/verify-share', requireSession, async (req, res) => {
  if (!isAllowedShareHost(req.query.shareUrl)) {
    return res.status(400).json({ error: 'shareUrl not from an allowed host' });
  }
  const resolved = await dns.resolve4(new URL(req.query.shareUrl).hostname);
  if (resolved.some(isPrivateIP)) return res.status(400).json({ error: 'forbidden' });

  const response = await fetch(req.query.shareUrl, { redirect: 'error', size: 4096 });
  const ShareMetaSchema = z.object({ valid: z.boolean(), expiresAt: z.string().datetime() });
  const meta = ShareMetaSchema.parse(await response.json());
  res.json(meta); // boolean + timestamp only; no raw response body
});
Detect SA-SKL-SSRF45 in your registry

SkillAudit scans for server-side URL fetch patterns in report export and download endpoints: missing allowlists on logo and template URLs, redirect-following fetch calls, and raw response body proxying to callers — the core patterns that turn report generation into an internal network pivot.

Scan your registry
FindingSeverityParameterImpact
SSRF45-001CRITICALreportLogoUrlIAM credentials exfiltrated from EC2 metadata service and embedded in generated PDF
SSRF45-002CRITICALexternalReportUrlInternal service catalog (Consul) proxied as PDF download response body
SSRF45-003CRITICALtemplateUrlVault KV secrets returned as report template content via CNAME redirect chain
SSRF45-004HIGHshareUrletcd cluster data stored as share verification metadata and returned in API response

See also: SA-SKL-SSRF44 (webhook delivery and callback SSRF patterns) for related server-side request forgery vulnerabilities in the skill notification delivery pipeline.