Claude MCP skill SSRF — skill CI/CD integration and build status webhook endpoints (SA-SKL-SSRF83)
SA-SKL-SSRF83 identifies four server-side request forgery vulnerabilities in MCP skill registry skill CI/CD integration and build status webhook endpoints. The build status notification endpoint fetches a user-supplied buildStatusUrl without validation, allowing an attacker to point it to 169.254.169.254 and retrieve full AWS IAM temporary credentials — including AccessKeyId, SecretAccessKey, and Token — in the build status notification response body returned to the attacker; the CI pipeline trigger endpoint fetches a user-supplied pipelineTriggerUrl without validation, and pointing it to Consul:8500/v1/catalog/services returns the full internal service catalog as the pipeline trigger acknowledgment body, mapping every microservice hostname and port in the registry's internal network; the deployment notification endpoint fetches a user-supplied deployNotifyUrl with redirect:follow, and constructing a CNAME chain resolving to Vault:8200/v1/secret/data/registry causes the deployment notification worker to follow the redirect and return Vault KV secrets including database credentials and API signing keys; and the build artifact export endpoint fetches a user-supplied artifactExportUrl and stores the raw response body as a build artifact record, allowing an attacker to point it to etcd:2379/v3/keys and persistently store the entire etcd cluster configuration as a retrievable build history entry via the registry's public build history API.
buildStatusUrl — attacker sets to 169.254.169.254; IAM credentials in build status notification response bodypipelineTriggerUrl — attacker points to Consul:8500; full service catalog as pipeline trigger acknowledgment bodydeployNotifyUrl with redirect:follow — CNAME chain to Vault:8200 returns KV secretsartifactExportUrl and stores raw response as build record — attacker points to etcd:2379; etcd config stored persistently via build history APISSRF83-001 — Build status notification fetches unvalidated URL leaking IAM credentials
The build status notification endpoint accepts a buildStatusUrl in the request body and POSTs a build status payload to that URL to notify the CI integration of the build outcome. Without URL validation, an attacker registers a CI integration with buildStatusUrl set to http://169.254.169.254/latest/meta-data/iam/security-credentials/. The notification worker performs a two-step IMDS walk: the first request returns the IAM role name, and the second request to /latest/meta-data/iam/security-credentials/{roleName} returns the full set of temporary credentials including AccessKeyId, SecretAccessKey, and Token. The registry then includes this IMDS response in the build status notification response body returned to the attacker's integration endpoint.
// SSRF83-001 — VULNERABLE
router.post('/builds/:id/notify',
requireSession,
async (req, res) => {
const build = await db.getBuild(req.params.id);
// No URL validation — attacker sets buildStatusUrl to 169.254.169.254
const response = await fetch(req.body.buildStatusUrl, {
method: 'POST',
body: JSON.stringify({ buildId: build.id, status: build.status, logs: build.logs })
});
const ack = await response.json();
res.json({ notified: true, ack });
}
);
// SSRF83-001 — FIXED: assertSafeExternalUrl; redirect:error; return only statusCode
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
router.post('/builds/:id/notify',
requireSession,
async (req, res) => {
const build = await db.getBuild(req.params.id);
assertSafeExternalUrl(req.body.buildStatusUrl); // throws on private/loopback/link-local
const response = await fetch(req.body.buildStatusUrl, {
method: 'POST',
redirect: 'error', // never follow redirects
body: JSON.stringify({ buildId: build.id, status: build.status })
// logs excluded from notification payload
});
res.json({ notified: true, statusCode: response.status });
}
);
SSRF83-002 — CI pipeline trigger fetches unvalidated URL returning internal service catalog
The CI pipeline trigger endpoint accepts a pipelineTriggerUrl in the request body and GETs that URL to invoke the downstream CI system's pipeline trigger webhook. Without URL validation, an attacker configures their CI integration with pipelineTriggerUrl set to http://consul:8500/v1/catalog/services. The trigger worker fetches this URL and returns the full Consul service catalog — containing every microservice name, address, port, and health status in the registry's internal network — as the pipeline trigger acknowledgment body in the API response.
// SSRF83-002 — VULNERABLE
router.post('/builds/:id/trigger',
requireSession,
async (req, res) => {
// No URL validation — attacker sets pipelineTriggerUrl to Consul:8500
const response = await fetch(req.body.pipelineTriggerUrl);
const ack = await response.json();
res.json({ triggered: true, ack });
}
);
// SSRF83-002 — FIXED: assertSafeExternalUrl; HEAD-only; return only statusCode
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
router.post('/builds/:id/trigger',
requireSession,
async (req, res) => {
assertSafeExternalUrl(req.body.pipelineTriggerUrl);
// HEAD-only: never read response body from internal trigger URL
const response = await fetch(req.body.pipelineTriggerUrl, { method: 'HEAD', redirect: 'error' });
res.json({ triggered: true, statusCode: response.status });
}
);
SSRF83-003 — Deployment notification follows redirect chain to Vault returning KV secrets
The deployment notification endpoint accepts a deployNotifyUrl and sends a POST request with redirect:follow to deliver the deployment event to downstream systems. An attacker registers a deployNotifyUrl pointing to an attacker-controlled domain with a CNAME record resolving to vault.internal:8200. When the notification worker follows the redirect chain, the final request reaches the Vault KV API endpoint /v1/secret/data/registry, which returns the registry's database connection strings, API signing keys, and third-party service credentials. These secrets are returned to the attacker in the deployment notification response body.
// SSRF83-003 — VULNERABLE: redirect:follow allows CNAME chain to internal services
router.post('/builds/:id/deploy-notify',
requireSession,
async (req, res) => {
// redirect:follow — CNAME chain to Vault:8200 leaks KV secrets
const response = await fetch(req.body.deployNotifyUrl, {
method: 'POST',
redirect: 'follow',
body: JSON.stringify({ buildId: req.params.id, deployed: true })
});
const ack = await response.json();
res.json({ notified: true, ack });
}
);
// SSRF83-003 — FIXED: assertSafeExternalUrl; redirect:error; return only statusCode
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
router.post('/builds/:id/deploy-notify',
requireSession,
async (req, res) => {
assertSafeExternalUrl(req.body.deployNotifyUrl);
const response = await fetch(req.body.deployNotifyUrl, {
method: 'POST',
redirect: 'error', // block CNAME-based redirect chains
body: JSON.stringify({ buildId: req.params.id, deployed: true })
});
res.json({ notified: true, statusCode: response.status });
}
);
SSRF83-004 — Build artifact export stores raw SSRF response body persistently
The build artifact export endpoint accepts an artifactExportUrl and fetches the artifact from that URL, storing the raw response body as a build artifact record retrievable via the registry's public build history API. An attacker points artifactExportUrl to http://etcd:2379/v3/keys?recursive=true. The export worker fetches the etcd KV store dump — containing all cluster configuration including etcd peer addresses, TLS certificates, and stored application secrets — and stores it as a build artifact record. The attacker then retrieves this record via the public build history API, obtaining the complete etcd cluster state without any authentication against the internal etcd service.
// SSRF83-004 — VULNERABLE: stores raw SSRF response body as artifact record
router.post('/builds/:id/artifact-export',
requireSession,
async (req, res) => {
// attacker sets artifactExportUrl to etcd:2379 — full cluster state stored
const response = await fetch(req.body.artifactExportUrl);
const artifactData = await response.text();
const record = await db.createArtifact({
buildId: req.params.id,
exportUrl: req.body.artifactExportUrl,
data: artifactData // raw SSRF response stored persistently
});
res.json({ artifactId: record.id });
}
);
// SSRF83-004 — FIXED: assertSafeExternalUrl; HEAD-only probe; store only URL and statusCode
const { assertSafeExternalUrl } = require('../lib/ssrf-guard');
router.post('/builds/:id/artifact-export',
requireSession,
async (req, res) => {
assertSafeExternalUrl(req.body.artifactExportUrl);
// HEAD-only: verify URL is reachable without reading response body
const probe = await fetch(req.body.artifactExportUrl, { method: 'HEAD', redirect: 'error' });
const record = await db.createArtifact({
buildId: req.params.id,
exportUrl: req.body.artifactExportUrl,
probeStatusCode: probe.status
// never store response body
});
res.json({ artifactId: record.id });
}
);
SkillAudit scans for all SA-SKL-SSRF83 patterns — unvalidated URL fetch in CI/CD webhook endpoints, redirect-following notification workers, and build record endpoints that store raw response bodies. Get a free audit to see the full SSRF analysis for your skill.