← Blog

Claude MCP skill SSRF — CI integration and GitHub Actions audit trigger — SA-SKL-SSRF24

MCP skill registries that integrate with CI/CD pipelines — triggering audit runs on push, validating GitHub Actions OIDC tokens for publisher authentication, and registering self-hosted runners — perform a range of outbound HTTP requests that touch attacker-controllable URLs. SA-SKL-SSRF24 covers four SSRF patterns that emerge from this CI integration surface: a webhook callback URL read from the payload body that lets an attacker invoke Jenkins builds; a GitHub Actions OIDC JWKS fetch that fires against the unvalidated iss claim before allowlist enforcement; a custom runner tarball download from a user-supplied URL; and an audit result delivery that follows server-side redirects to reach an internal Elasticsearch cluster.

By SkillAudit  |  13 Nov 2026
SA-SKL-SSRF24 findings at a glance
CRITICALSSRF24-001 — CI audit trigger reads runnerCallbackUrl from incoming webhook payload body and POSTs audit result JSON to that URL; attacker sets runnerCallbackUrl: "http://10.0.0.5:8080/jenkins/job/deploy-prod/build?token=admintoken" to trigger an internal Jenkins production deployment
CRITICALSSRF24-002 — GitHub Actions OIDC token validator fetches JWKS from the iss claim URL before checking an issuer allowlist; attacker sets iss: "http://169.254.169.254/latest/meta-data/iam/security-credentials/github-actions-role"; SSRF fires and, if validator fails open on JWKS error, the forged token is accepted
HIGHSSRF24-003 — Custom GitHub Actions runner registration fetches runner.tar.gz from a user-supplied tarballUrl in the registration request body; attacker sets tarballUrl: "http://169.254.169.254/latest/meta-data/iam/security-credentials/runner-role" to exfiltrate cloud IAM credentials
HIGHSSRF24-004 — Audit webhook result delivery uses fetch(webhookUrl, { redirect: 'follow' }); a stored and previously validated webhookUrl responds with a redirect to http://10.0.0.1:9200/_cat/indices?v (internal Elasticsearch); the fetch follows the redirect, reaching the internal service

SSRF24-001 — CI audit trigger callback URL read from webhook payload body

When an MCP skill registry integrates with a CI system to trigger audit runs on code push, a common pattern is to accept an inbound webhook from GitHub or GitLab that includes metadata about the push event. Some implementations extend this webhook schema to include a runnerCallbackUrl field — a URL to which the registry POSTs the audit result JSON once the run completes. This design is convenient for CI orchestration: the CI system supplies its own callback endpoint and the registry delivers results without polling. The critical flaw is that runnerCallbackUrl is supplied by the webhook sender, not looked up from a server-side configuration record. An attacker who can send an authenticated or unauthenticated webhook (or who compromises a CI system) crafts a payload with a callback URL pointing to an internal service on the registry's network — a Jenkins instance, an internal admin panel, or a Kubernetes API server. The registry's POST to that URL carries the audit result JSON as the request body, which is sufficient to trigger Jenkins parameterized builds that accept any POST with the correct token in the query string.

The impact is not just SSRF data leakage — it is arbitrary internal HTTP POST with a JSON body. An attacker who knows the Jenkins job name and API token (both of which may be guessable or previously leaked) can trigger a production deployment pipeline by routing the registry's callback POST to http://10.0.0.5:8080/jenkins/job/deploy-prod/build?token=admintoken. Because the registry is on the same private network as the Jenkins server, the request bypasses Jenkins's network perimeter entirely.

Vulnerable
// SSRF24-001 — VULNERABLE
// CI audit trigger reads runnerCallbackUrl from webhook payload body,
// then POSTs audit result to that URL — SSRF to internal Jenkins/TeamCity.

router.post('/webhooks/ci-push', verifyWebhookSignature, async (req, res) => {
  const { repoUrl, commitSha, runnerCallbackUrl } = req.body;
  // Attacker payload:
  // {
  //   "repoUrl": "https://github.com/attacker/skill",
  //   "commitSha": "abc123",
  //   "runnerCallbackUrl": "http://10.0.0.5:8080/jenkins/job/deploy-prod/build?token=admintoken"
  // }

  res.status(202).json({ status: 'queued' });

  // Audit runs asynchronously, then delivers result to the callback URL
  const auditResult = await runSkillAudit(repoUrl, commitSha);

  // VULNERABLE: POSTing to attacker-controlled URL
  // This fires an HTTP POST to the internal Jenkins server, triggering a build
  await fetch(runnerCallbackUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(auditResult),
  });
});
Fixed
// SSRF24-001 — FIXED
// Callback URL is never accepted from the webhook payload body.
// It is looked up from the authenticated org's server-side CI configuration.
// Optional configurable callback applies SSRF guard before use.

import { getOrgCiConfig } from './org-config.js';
import { assertSafeUrl }  from './ssrf-guard.js';

router.post('/webhooks/ci-push', verifyWebhookSignature, async (req, res) => {
  const { repoUrl, commitSha, orgId } = req.body;
  // Fix 1: orgId is verified by the webhook signature — it cannot be spoofed
  // if verifyWebhookSignature validates the HMAC over the full payload including orgId.

  res.status(202).json({ status: 'queued' });

  // Fix 2: load callback URL from server-side config keyed to the authenticated org
  const ciConfig = await getOrgCiConfig(orgId);
  // ciConfig.callbackUrl was validated with assertSafeUrl() when the org saved it
  const callbackUrl = ciConfig?.callbackUrl ?? null;

  const auditResult = await runSkillAudit(repoUrl, commitSha);

  if (callbackUrl) {
    // Fix 3: re-validate at delivery time (URL may have been stored before SSRF
    // guard was introduced, or the DNS record may have been repointed)
    await assertSafeUrl(callbackUrl); // throws if URL resolves to private IP

    await fetch(callbackUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(auditResult),
      redirect: 'error',                       // Fix 4: never follow redirects
      signal: AbortSignal.timeout(10_000),
    });
  }
});

POST-based SSRF triggers side effects, not just data leakage: Classic GET-based SSRF reads data from internal services. POST-based SSRF, as in SSRF24-001, also triggers state changes: Jenkins /build, TeamCity /app/rest/buildQueue, and Argo CD /api/v1/applications/<name>/sync all accept POST requests that initiate deployments. An attacker who can route the registry's audit-result POST to any of these endpoints — with the correct query parameter token — can trigger a production deployment without credentials beyond the CI token already embedded in the URL. Never accept a callback URL from an external webhook payload; always derive it from server-side configuration owned by the authenticated org.

SSRF24-002 — GitHub Actions OIDC issuer claim fetched before allowlist check

MCP skill registries that allow GitHub Actions workflows to authenticate as skill publishers typically accept a GitHub Actions OIDC JWT, validate its signature against the GitHub JWKS, and extract the repository and workflow identity from the claims. The OIDC specification says the JWKS endpoint URL is derived from the iss (issuer) claim: append /.well-known/openid-configuration to the issuer URL, fetch it, read the jwks_uri field, and fetch the JWKS from that URI. A vulnerable implementation performs this discovery flow against whatever iss value is in the JWT header or payload — before checking that the issuer is one of the expected values. An attacker crafts a self-signed JWT with iss: "http://169.254.169.254/latest/meta-data/iam/security-credentials/github-actions-role". The validator fetches that URL as if it were an OIDC discovery endpoint. The HTTP GET to the EC2 instance metadata endpoint fires immediately — SSRF. Even though the response is not a valid OIDC discovery document, the network request has already reached the internal endpoint. If the validator additionally fails open on JWKS fetch or parse errors — returning a success result when it cannot validate the signature — the forged JWT is accepted and the attacker gains publisher-level access to the registry.

The two-layer impact makes this finding critical: the SSRF fires unconditionally on JWT submission, and the fail-open validation logic (common in libraries that treat "no matching key found" as a soft error) means the token may be accepted. Both issues must be fixed independently. The SSRF guard is the primary fix; the fail-closed behavior is a defence-in-depth requirement that limits the blast radius of any future bypass.

Vulnerable
// SSRF24-002 — VULNERABLE
// GitHub Actions OIDC validator fetches JWKS from the iss claim URL
// before checking the issuer against an allowlist.
// If JWKS fetch fails, the validator fails open and accepts the token.

import jwt from 'jsonwebtoken';
import jwksClient from 'jwks-rsa';

async function validateGitHubActionsOidcToken(rawToken) {
  // VULNERABLE: decode without verification to read the iss claim
  const decoded = jwt.decode(rawToken, { complete: true });
  const issuer  = decoded?.payload?.iss;

  // VULNERABLE: construct JWKS URL from attacker-controlled iss claim —
  // attacker sets iss: "http://169.254.169.254/latest/meta-data/iam/security-credentials/github-actions-role"
  const jwksUri = `${issuer}/.well-known/jwks.json`;

  const client = jwksClient({ jwksUri }); // HTTP GET fires here — SSRF

  const getKey = (header, cb) => {
    client.getSigningKey(header.kid, (err, key) => {
      if (err) return cb(null, null); // FAIL OPEN: returns null key on error
      cb(null, key.getPublicKey());
    });
  };

  return new Promise((resolve) => {
    jwt.verify(rawToken, getKey, { algorithms: ['RS256'] }, (err, claims) => {
      if (err && !claims) return resolve(null); // FAIL OPEN on verify error
      resolve(claims); // attacker's forged token is accepted
    });
  });
}
Fixed
// SSRF24-002 — FIXED
// Issuer validated against a hardcoded allowlist BEFORE any JWKS fetch.
// Validator fails closed: any error returns null (token rejected).

import jwt from 'jsonwebtoken';
import jwksClient from 'jwks-rsa';

// Fix 1: hardcoded allowlist of accepted GitHub Actions OIDC issuers
const GITHUB_ACTIONS_ISSUER_ALLOWLIST = new Set([
  'https://token.actions.githubusercontent.com',
]);

// Fix 2: hardcoded JWKS URI — never derive from token claims
const GITHUB_ACTIONS_JWKS_URI =
  'https://token.actions.githubusercontent.com/.well-known/jwks';

const trustedClient = jwksClient({
  jwksUri: GITHUB_ACTIONS_JWKS_URI,
  cache:   true,
  rateLimit: true,
  jwksRequestsPerMinute: 5,
});

async function validateGitHubActionsOidcToken(rawToken) {
  // Fix 3: decode without verification to read iss — but check allowlist FIRST
  // before any network activity occurs
  let decoded;
  try {
    decoded = jwt.decode(rawToken, { complete: true });
  } catch {
    return null; // fail closed: malformed token
  }

  const issuer = decoded?.payload?.iss;

  // Fix 4: allowlist check BEFORE JWKS fetch — reject unknown issuers immediately
  if (!issuer || !GITHUB_ACTIONS_ISSUER_ALLOWLIST.has(issuer)) {
    // No network request has been made at this point
    return null; // fail closed
  }

  // Fix 5: use the hardcoded JWKS URI, not the iss-derived URI
  const getKey = (header, cb) => {
    trustedClient.getSigningKey(header.kid, (err, key) => {
      if (err) return cb(err);           // propagate error — do NOT fail open
      cb(null, key.getPublicKey());
    });
  };

  return new Promise((resolve) => {
    jwt.verify(
      rawToken,
      getKey,
      {
        algorithms:  ['RS256'],
        issuer:      [...GITHUB_ACTIONS_ISSUER_ALLOWLIST], // Fix 6: verify iss claim
        audience:    'skillaudit.dev',                     // Fix 7: verify aud claim
      },
      (err, claims) => {
        if (err) return resolve(null); // fail closed on any verification error
        resolve(claims);
      }
    );
  });
}

Fail-open OIDC validation is a complete authentication bypass: SSRF24-002 is critical for two independent reasons. First, the SSRF fires unconditionally when any JWT is submitted — the network request to 169.254.169.254 occurs before the token signature is checked. Second, if the JWKS fetch returns a non-JSON body (which the metadata endpoint does), many JWKS client libraries throw or return an empty key set. A validator that treats "no matching key" as a soft error will call jwt.verify with a null signing key, which some versions of jsonwebtoken accept for tokens signed with alg: "none". The fix is strict: validate the issuer allowlist before any fetch, use a hardcoded JWKS URI, and fail closed on every error path. For related OAuth2 misconfiguration patterns in GitHub/GitLab integration, see SA-SKL-AUTH15.

SSRF24-003 — Custom runner registration fetches tarball from user-supplied URL

Some MCP skill registries allow organisations to register self-hosted GitHub Actions runners — custom execution environments for skill audit pipelines. The runner registration flow asks the registering org to supply a tarballUrl from which the registry downloads the runner binary before provisioning it. This feature exists because enterprise customers may host custom-patched runner binaries on private artifact servers. When this download URL is accepted from the registration request body without SSRF validation, an attacker with an org account sends a registration request with tarballUrl: "http://169.254.169.254/latest/meta-data/iam/security-credentials/runner-role". The registry server fetches that URL to download the "tarball". The response is the plaintext JSON of the IAM role credentials attached to the registry server's cloud instance — immediately returned in the HTTP response body or logged in the registry's download error logs.

The download step typically happens synchronously before the registration is confirmed, so the attacker receives the SSRF response in the registration API response or can poll the registration status endpoint which may include the download error message. Even if the response body is not directly returned, the credentials appear in structured logs that are often shipped to a log aggregation service accessible to any org admin.

Vulnerable
// SSRF24-003 — VULNERABLE
// Runner registration accepts tarballUrl from request body without SSRF guard.
// Fetches the tarball to validate it — SSRF to EC2 metadata or internal services.

router.post('/api/runners/register', authenticate, async (req, res) => {
  const { orgId, runnerName, tarballUrl } = req.body;
  // Attacker sends:
  // { "runnerName": "my-runner", "tarballUrl": "http://169.254.169.254/latest/meta-data/iam/security-credentials/runner-role" }

  // VULNERABLE: fetch to attacker-supplied tarball URL — no SSRF guard
  const response = await fetch(tarballUrl);
  if (!response.ok) {
    // Error message may include response body from internal service
    const body = await response.text();
    return res.status(400).json({ error: `Failed to fetch tarball: ${body}` });
  }

  const tarball = await response.arrayBuffer();
  // validate tarball checksum, unpack, provision runner...
  await provisionRunner(orgId, runnerName, Buffer.from(tarball));
  res.status(201).json({ status: 'registered' });
});
Fixed
// SSRF24-003 — FIXED
// tarballUrl validated against a domain allowlist before fetch.
// SSRF guard applied even for allowlisted domains.
// Error responses never include upstream response body.

import { assertSafeUrl } from './ssrf-guard.js';

// Fix 1: allowlist of permitted tarball origins
const RUNNER_TARBALL_DOMAIN_ALLOWLIST = new Set([
  'github.com',
  'objects.githubusercontent.com',
  'releases.githubusercontent.com',
]);

async function validateRunnerTarballUrl(rawUrl) {
  let url;
  try {
    url = new URL(rawUrl);
  } catch {
    throw new Error('Invalid tarball URL');
  }

  // Fix 2: HTTPS only
  if (url.protocol !== 'https:') {
    throw new Error('Runner tarball URL must use HTTPS');
  }

  // Fix 3: domain allowlist check — reject any hostname not in the list
  if (!RUNNER_TARBALL_DOMAIN_ALLOWLIST.has(url.hostname)) {
    throw new Error(`Runner tarball domain not permitted: ${url.hostname}`);
  }

  // Fix 4: SSRF guard — DNS resolution + RFC1918 / link-local blocklist
  // (defence in depth: allowlisted domains could theoretically alias to private IPs)
  await assertSafeUrl(url.toString());

  return url;
}

router.post('/api/runners/register', authenticate, async (req, res) => {
  const { orgId, runnerName, tarballUrl } = req.body;

  let validatedUrl;
  try {
    validatedUrl = await validateRunnerTarballUrl(tarballUrl);
  } catch (err) {
    // Fix 5: error message never reveals upstream response body
    return res.status(400).json({ error: err.message });
  }

  const response = await fetch(validatedUrl.toString(), {
    redirect: 'error',                    // Fix 6: no redirect following
    signal: AbortSignal.timeout(60_000),  // 60s for binary download
  });

  if (!response.ok) {
    // Fix 7: return generic error — do not echo response body from upstream
    return res.status(400).json({ error: 'Failed to fetch runner tarball' });
  }

  const tarball = await response.arrayBuffer();
  await provisionRunner(orgId, runnerName, Buffer.from(tarball));
  res.status(201).json({ status: 'registered' });
});

Domain allowlists alone are not sufficient without DNS validation: SSRF24-003 uses a two-layer approach: domain allowlist plus DNS-resolution SSRF guard. The allowlist prevents requests to arbitrary domains. The DNS check catches edge cases where an allowlisted domain has a dangling CNAME that resolves to a private IP — an unusual but real scenario in environments where the registry's internal DNS server is not the same as the public DNS. Setting redirect: 'error' is also critical: even a valid objects.githubusercontent.com URL could redirect to an attacker-controlled URL that in turn redirects to an internal service, bypassing both checks. For SSRF patterns in package metadata fetching from npm registry proxies, see SA-SKL-SSRF23.

SSRF24-004 — Audit webhook result delivery follows redirects to internal Elasticsearch

When an MCP skill registry delivers audit results to an organisation's configured webhook URL, it performs an HTTP POST to the stored endpoint. The stored URL was validated at registration time — typically checked against an SSRF guard that confirmed the domain resolved to a public IP at the moment of configuration. However, if the fetch at delivery time is performed with redirect: 'follow', the target server can respond with an HTTP 301 or 302 redirect to any URL it chooses, including internal services that are unreachable from the public internet. The redirect destination is not re-validated against the SSRF guard: validation happened once, at registration, against the original URL. At delivery time, the fetch blindly follows the redirect to http://10.0.0.1:9200/_cat/indices?v — the internal Elasticsearch REST API — and the response (a list of all index names) is returned to the calling code, potentially logged or included in delivery error details.

This is a DNS-rebinding variant of SSRF, though implemented without actual DNS rebinding: the legitimate public webhook endpoint simply issues a redirect to an internal address. This pattern is especially relevant for organisations that operate their own webhook aggregators (like Hookdeck or a self-hosted AKHQ) which may issue redirects for load balancing or routing purposes. The fix requires setting redirect: 'error' on all webhook delivery fetches. If redirect-following is a genuine product requirement, every URL in the redirect chain must be re-validated against the SSRF guard before the next hop is followed.

Vulnerable
// SSRF24-004 — VULNERABLE
// Audit webhook result delivery uses redirect: 'follow' (the default).
// Stored webhookUrl was validated at registration, but at delivery time
// the target server responds with a redirect to an internal Elasticsearch node.

async function deliverAuditWebhook(webhookUrl, auditResult) {
  // webhookUrl was validated when the org configured it — e.g. https://hooks.example.com/skill-audit
  // But at delivery time, hooks.example.com responds:
  //   HTTP/1.1 301 Moved Permanently
  //   Location: http://10.0.0.1:9200/_cat/indices?v

  // VULNERABLE: redirect: 'follow' is the default — fetch follows the redirect
  // to the internal Elasticsearch node; response body is returned to this function
  const response = await fetch(webhookUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(auditResult),
    // redirect: 'follow' is the implicit default
  });

  if (!response.ok) {
    const errorBody = await response.text();
    // errorBody may contain Elasticsearch index listing — leaked to delivery error log
    logger.error({ webhookUrl, errorBody }, 'Webhook delivery failed');
  }
}
Fixed
// SSRF24-004 — FIXED
// redirect: 'error' — any redirect causes delivery to fail rather than follow.
// If redirect-following is required, re-validate each hop against the SSRF guard.
// Error responses never include upstream response body in logs.

import { assertSafeUrl } from './ssrf-guard.js';

async function deliverAuditWebhook(webhookUrl, auditResult) {
  // Fix 1: re-validate the stored URL at delivery time (not just at registration)
  // Catches cases where the DNS record was updated after the URL was stored.
  await assertSafeUrl(webhookUrl);

  let response;
  try {
    response = await fetch(webhookUrl, {
      method:  'POST',
      headers: { 'Content-Type': 'application/json' },
      body:    JSON.stringify(auditResult),
      redirect: 'error',                   // Fix 2: fail on any redirect
      signal:   AbortSignal.timeout(15_000),
    });
  } catch (err) {
    // Fix 3: log the error type and URL only — never log upstream response body
    logger.warn({ webhookUrl, errorType: err.constructor.name }, 'Webhook delivery error');
    return { delivered: false, reason: 'fetch_error' };
  }

  if (!response.ok) {
    // Fix 4: do not read or log the response body from a failed delivery
    logger.warn({ webhookUrl, status: response.status }, 'Webhook delivery failed');
    return { delivered: false, reason: `http_${response.status}` };
  }

  return { delivered: true };
}

// If redirect-following is a hard product requirement, use this safer variant:
async function deliverWithRedirectFollow(initialUrl, auditResult, maxHops = 3) {
  let currentUrl = initialUrl;

  for (let hop = 0; hop < maxHops; hop++) {
    // Fix 5: validate EVERY URL in the redirect chain before fetching it
    await assertSafeUrl(currentUrl);

    const response = await fetch(currentUrl, {
      method:   'POST',
      headers:  { 'Content-Type': 'application/json' },
      body:     hop === 0 ? JSON.stringify(auditResult) : undefined,
      redirect: 'manual',                  // Fix 6: manual redirect — we handle hops
      signal:   AbortSignal.timeout(10_000),
    });

    if (response.status >= 300 && response.status < 400) {
      const location = response.headers.get('location');
      if (!location) return { delivered: false, reason: 'missing_location' };
      currentUrl = new URL(location, currentUrl).toString(); // resolve relative URLs
      continue;
    }

    return { delivered: response.ok, status: response.status };
  }

  return { delivered: false, reason: 'too_many_redirects' };
}

Redirect-based SSRF bypasses registration-time URL validation: SSRF24-004 illustrates why one-time URL validation at configuration is not sufficient for webhook delivery. The validation at registration time establishes that the URL pointed to a public server at that moment. It says nothing about what that server will do at delivery time. Setting redirect: 'error' is the safe default because it prevents the delivery code from reaching any URL that was not explicitly stored and validated. If the product must support redirects — for example, because organisations use load balancers that redirect to backend shards — implement the per-hop validation loop shown in deliverWithRedirectFollow: call assertSafeUrl before every fetch in the chain, and use redirect: 'manual' so each hop is explicit. Never use the default redirect: 'follow' in server-side HTTP clients that handle user-influenced URLs.

How SkillAudit detects SA-SKL-SSRF24

SkillAudit's CI integration SSRF scanner applies four checks for the SA-SKL-SSRF24 family:

Summary

FindingSeverityRoot causeFix
SSRF24-001 CRITICAL CI audit trigger reads runnerCallbackUrl from webhook payload body and POSTs to it — SSRF to internal Jenkins/TeamCity Never accept callback URL from external webhook payload; derive from server-side org CI config; apply SSRF guard at delivery time
SSRF24-002 CRITICAL OIDC JWKS fetched from iss claim URL before issuer allowlist check — SSRF to EC2 metadata; fail-open on JWKS error accepts forged token Validate iss against hardcoded allowlist before any fetch; use hardcoded JWKS URI; fail closed on every error path
SSRF24-003 HIGH Runner registration fetches tarball from user-supplied tarballUrl without SSRF guard — EC2 IAM credentials exfiltrated Domain allowlist (github.com, objects.githubusercontent.com); SSRF guard (HTTPS-only, DNS, RFC1918 blocklist); redirect: 'error'
SSRF24-004 HIGH Audit webhook delivery uses redirect: 'follow'; previously-validated URL redirects to internal Elasticsearch at delivery time Set redirect: 'error'; re-validate destination on each redirect hop if follow is required; re-run SSRF guard at delivery time

Related SA-SKL findings: SSRF24-002's OIDC misconfiguration shares root causes with the OAuth2 scope and token validation issues documented in SA-SKL-AUTH15 — both arise from trusting token claims before verifying them against a server-side allowlist. SSRF24-003's tarball URL fetch mirrors the dependency tarball pattern in SA-SKL-SSRF23 (SSRF23-004), with the difference that the URL here comes directly from a user API call rather than from a published package's metadata. The shared fix for all four SA-SKL-SSRF24 patterns is a centralised assertSafeUrl() utility applied at every server-side fetch site — combined with redirect: 'error' on all webhook delivery fetches.