← Security advisories

Claude MCP skill SSRF — skill CI/CD pipeline integration and trigger endpoints — SA-SKL-SSRF60

SA-SKL-SSRF60 documents four server-side request forgery vulnerabilities in MCP skill registry CI/CD pipeline integration and trigger endpoints. These endpoints accept user-supplied URLs for pipeline trigger confirmation, status callbacks, artifact delivery, and health check operations — all of which result in server-side HTTP requests that the attacker can redirect to internal infrastructure. The resulting SSRF reads reach IMDS for cloud provider credentials, Consul for internal service topology, Vault for KV secrets via CNAME-based redirect chains, and etcd for cluster configuration data that is then stored persistently as pipeline health records.

SA-SKL-SSRF60 findings at a glance
CRITICALSSRF60-001 — CI pipeline trigger endpoint fetches user-supplied pipelineTriggerUrl — attacker sets to 169.254.169.254; IAM credentials embedded in pipeline trigger confirmation response returned to caller; credentials valid for remaining rotation window (~30–60 min) granting write access to all S3/DynamoDB/Secrets Manager resources; fix: allowlist; DNS private-IP block; redirect:error; return only HTTP status boolean
CRITICALSSRF60-002 — pipeline status callback endpoint fetches user-supplied statusCallbackUrl — attacker points to Consul:8500; Consul catalog JSON returned as pipeline status confirmation containing full internal network topology; fix: allowlist; Zod parse only boolean confirmed; never proxy raw response body
CRITICALSSRF60-003 — pipeline artifact delivery endpoint fetches user-supplied artifactDeliveryUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secrets as artifact delivery confirmation; CNAME-based rebinding defeats IP-only allowlists; fix: redirect:error; allowlist; extract only structured delivery schema
HIGHSSRF60-004 — CI health check endpoint fetches user-supplied healthCheckUrl and stores raw response as pipeline health record — attacker points to etcd:2379; etcd configuration data stored persistently as health record readable via CI history API; fix: allowlist; return only boolean healthy; never store raw response body

SSRF60-001 — IMDS credential exfiltration via pipeline trigger URL

Severity: CRITICAL

The CI pipeline trigger endpoint accepts a pipelineTriggerUrl in the request body and issues a server-side POST to that URL as part of the pipeline dispatch flow. The endpoint does not validate the URL against an allowlist or block private IP ranges. An attacker submits pipelineTriggerUrl: "http://169.254.169.254/latest/meta-data/iam/security-credentials/registry-role". The registry server fetches that URL, receives the JSON response containing AccessKeyId, SecretAccessKey, and Token for the registry's IAM role, and returns the entire fetch response body as the pipeline trigger confirmation — which the API response includes verbatim. The credentials are valid for the remainder of their rotation window, typically 30–60 minutes, and authorize write access to all AWS resources the registry role can reach.

Vulnerable
// POST /api/skills/:id/pipeline/trigger
router.post('/:id/pipeline/trigger', requireSession, async (req, res) => {
  const { pipelineTriggerUrl, payload } = req.body;
  // No URL validation — fetches any URL including 169.254.169.254
  const result = await fetch(pipelineTriggerUrl, {
    method: 'POST',
    body: JSON.stringify(payload),
    headers: { 'Content-Type': 'application/json' },
  });
  const confirmation = await result.json();
  return res.json({ triggered: true, confirmation });  // proxies IMDS response
});
Fixed
// POST /api/skills/:id/pipeline/trigger — URL allowlist + IP block + status-only response
import { URL } from 'url';
import dns from 'dns/promises';

const TRIGGER_ALLOWLIST = process.env.PIPELINE_TRIGGER_ALLOWLIST.split(',');

async function isPrivateIP(hostname) {
  const addrs = await dns.resolve4(hostname).catch(() => []);
  return addrs.some(ip => /^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|127\.|169\.254\.)/.test(ip));
}

router.post('/:id/pipeline/trigger', requireSession, async (req, res) => {
  const { pipelineTriggerUrl, payload } = req.body;
  let parsed;
  try { parsed = new URL(pipelineTriggerUrl); } catch { return res.status(400).json({ error: 'Invalid URL' }); }

  if (!TRIGGER_ALLOWLIST.some(a => parsed.hostname.endsWith(a))) {
    return res.status(403).json({ error: 'URL not in allowlist' });
  }
  if (await isPrivateIP(parsed.hostname)) {
    return res.status(403).json({ error: 'Private IP not allowed' });
  }

  const result = await fetch(pipelineTriggerUrl, {
    method: 'POST',
    body: JSON.stringify(payload),
    redirect: 'error',  // no redirect following
    headers: { 'Content-Type': 'application/json' },
  });
  // return only HTTP status — never proxy response body
  return res.json({ triggered: result.ok, status: result.status });
});

SSRF60-002 — Internal network topology via pipeline status callback URL

Severity: CRITICAL

The pipeline status callback endpoint accepts a statusCallbackUrl and issues a GET request to confirm delivery. An attacker supplies http://consul.service.consul:8500/v1/catalog/services. The server proxies the Consul catalog response — containing the names, addresses, and health states of all internal services — as the pipeline status confirmation body, which the API response returns verbatim to the caller.

Vulnerable
// POST /api/skills/:id/pipeline/status-callback
router.post('/:id/pipeline/status-callback', requireSession, async (req, res) => {
  const { statusCallbackUrl, statusPayload } = req.body;
  const r = await fetch(statusCallbackUrl, { method: 'POST', body: JSON.stringify(statusPayload) });
  const confirmation = await r.json();
  return res.json({ confirmed: true, confirmation });  // proxies Consul response
});
Fixed
// POST /api/skills/:id/pipeline/status-callback — allowlist + schema-only response
router.post('/:id/pipeline/status-callback', requireSession, async (req, res) => {
  const { statusCallbackUrl, statusPayload } = req.body;
  if (!isAllowlisted(statusCallbackUrl)) return res.status(403).json({ error: 'URL not allowed' });

  const r = await fetch(statusCallbackUrl, {
    method: 'POST',
    body: JSON.stringify(statusPayload),
    redirect: 'error',
  });

  // parse and discard raw body — return only structured boolean
  const ConfirmSchema = z.object({ confirmed: z.boolean() });
  const body = await r.json().catch(() => ({}));
  const safe = ConfirmSchema.safeParse(body);
  return res.json({ confirmed: safe.success ? safe.data.confirmed : false });
});

SSRF60-003 — Vault secret exfiltration via CNAME chain in artifact delivery URL

Severity: CRITICAL

The pipeline artifact delivery endpoint fetches artifactDeliveryUrl with redirect: 'follow'. An attacker controls a domain with a CNAME record pointing to the internal Vault service (vault.service.consul:8200). They submit their domain as the artifact delivery URL. The registry server resolves the CNAME, follows the redirect chain, reaches Vault, and returns the full KV secrets response as the artifact delivery confirmation. CNAME-based SSRF defeats IP-only allowlists because the initial DNS lookup resolves to a public IP — the CNAME redirect to an internal address occurs after the allowlist check.

redirect:follow defeats IP-based allowlists. Any SSRF defense that checks the initial URL against an IP allowlist but then follows HTTP redirects is bypassable via DNS rebinding or CNAME chains. The fix requires redirect: 'error' in the fetch options — if the destination requires a redirect, provide the final URL directly.

Vulnerable
// POST /api/skills/:id/pipeline/deliver-artifact
router.post('/:id/pipeline/deliver-artifact', requireSession, async (req, res) => {
  const { artifactDeliveryUrl, artifact } = req.body;
  // redirect:follow enables CNAME chain to Vault
  const r = await fetch(artifactDeliveryUrl, {
    method: 'POST',
    body: JSON.stringify(artifact),
    redirect: 'follow',  // VULNERABLE
  });
  const confirmation = await r.json();
  return res.json({ delivered: true, confirmation });  // proxies Vault response
});
Fixed
// POST /api/skills/:id/pipeline/deliver-artifact — redirect:error + schema extraction
router.post('/:id/pipeline/deliver-artifact', requireSession, async (req, res) => {
  const { artifactDeliveryUrl, artifact } = req.body;
  if (!isAllowlisted(artifactDeliveryUrl)) return res.status(403).json({ error: 'URL not allowed' });

  const r = await fetch(artifactDeliveryUrl, {
    method: 'POST',
    body: JSON.stringify(artifact),
    redirect: 'error',  // CNAME chains blocked
  });

  const DeliverySchema = z.object({ received: z.boolean(), artifactId: z.string().optional() });
  const body = await r.json().catch(() => ({}));
  const safe = DeliverySchema.safeParse(body);
  return res.json({ delivered: r.ok, artifactId: safe.success ? safe.data.artifactId : null });
});

SSRF60-004 — etcd data stored as pipeline health record via health check URL

Severity: HIGH

The CI health check endpoint fetches user-supplied healthCheckUrl and stores the raw response body as the pipeline health record in the CI history database. An attacker supplies http://etcd.service.consul:2379/v2/keys/. The server fetches the etcd key listing, stores it as the health record, and the data becomes readable via the CI history API by any user with read access to the pipeline. The stored etcd data includes cluster membership, stored configuration keys, and potentially internal secrets stored in etcd — all readable from the CI history API without direct etcd access.

Vulnerable
// POST /api/skills/:id/pipeline/health-check
router.post('/:id/pipeline/health-check', requireSession, async (req, res) => {
  const { healthCheckUrl } = req.body;
  const r = await fetch(healthCheckUrl);
  const rawBody = await r.text();
  // stores raw etcd response in CI history database
  await PipelineHealth.create({ skillId: req.params.id, rawResponse: rawBody, checkedAt: new Date() });
  return res.json({ healthy: r.ok });
});
Fixed
// POST /api/skills/:id/pipeline/health-check — allowlist + boolean-only storage
router.post('/:id/pipeline/health-check', requireSession, async (req, res) => {
  const { healthCheckUrl } = req.body;
  if (!isAllowlisted(healthCheckUrl)) return res.status(403).json({ error: 'URL not allowed' });

  const r = await fetch(healthCheckUrl, { redirect: 'error' });
  // store only boolean outcome — never store raw response body
  await PipelineHealth.create({
    skillId: req.params.id,
    healthy: r.ok,
    statusCode: r.status,
    checkedAt: new Date(),
  });
  return res.json({ healthy: r.ok });
});

All four SA-SKL-SSRF60 vulnerabilities stem from the same pattern: user-supplied URLs passed directly to server-side HTTP fetch calls without allowlist validation, with response bodies proxied back to callers or stored persistently. SkillAudit detects these patterns with AST queries targeting fetch(req.body.*Url) without prior URL validation, redirect: 'follow' on fetches accepting user-supplied URLs, and database writes where the value field originates from an HTTP response body. See also SA-SKL-SSRF59 on analytics export and reporting endpoints for the companion SSRF chain targeting data export workflows.