Claude MCP skill SSRF via health check and monitoring endpoints in MCP skill infrastructure — SA-SKL-SSRF19
MCP skill registries provide operational features that accept developer-submitted URLs: health check endpoints polled to verify skill availability, webhook URLs for event notifications, CI/CD pipeline status URLs for build integration, and preview screenshot URLs for OG image generation. Each accepted URL is a potential SSRF vector — when a registry worker makes an HTTP request to a developer-supplied URL without validating the target IP, attackers can redirect internal service requests to metadata APIs, admin dashboards, and internal monitoring infrastructure. SA-SKL-SSRF19 covers four SSRF patterns in MCP skill infrastructure management features.
GET skillHealthCheckUrl every 60s to track uptime — attacker sets healthCheckUrl: "http://169.254.169.254/latest/meta-data/iam/security-credentials/app-role"; periodic worker fetch leaks IAM credentials; or internal target http://10.0.0.5:9090/metrics returns Prometheus application metricswebhookUrl on audit-complete, billing alert, and version events — attacker sets webhook to http://10.0.0.10:5601/api/saved_objects/ (Kibana admin API); response body from internal service reflected in delivery receiptpipelineStatusUrl to http://internal-jenkins:8080/job/deploy-prod/api/json; registry reads Jenkins job details including last deploy parameterspage.goto(skill.previewUrl) to generate OG social preview screenshot — attacker sets previewUrl: "http://localhost:3001/admin"; Puppeteer renders internal admin panel; screenshot stored as skill's OG imageSSRF19-001 — Developer skill health check URL polled periodically by registry monitoring
MCP skill registries display uptime badges on skill listing pages. To power these badges, a background worker polls each registered skill's healthCheckUrl on a fixed schedule (commonly every 60 seconds) and records whether the response returned HTTP 200. The healthCheckUrl is supplied by the developer during skill registration. Without SSRF validation, an attacker registers a skill whose healthCheckUrl points to the EC2 Instance Metadata Service (IMDS). Every 60 seconds the monitoring worker fetches http://169.254.169.254/latest/meta-data/iam/security-credentials/app-role and receives the registry's IAM role credentials — including an access key ID, secret access key, and temporary session token. The response body may be stored in the uptime log for debugging, or the attacker can direct the IMDS response to a redirect target they control.
// VULNERABLE — registry uptime monitor
async function checkSkillHealth(skill) {
const res = await fetch(skill.healthCheckUrl, { timeout: 5000 });
skill.status = res.ok ? 'up' : 'down';
await db.uptimeLog.insert({ skillId: skill.id, status: skill.status, checkedAt: Date.now() });
}
// Attacker skill registration:
// healthCheckUrl: "http://169.254.169.254/latest/meta-data/iam/security-credentials/app-role"
// Worker fetches → { "AccessKeyId": "AKIA...", "SecretAccessKey": "wJalr...", "Token": "AQo..." }
// Response stored in uptimeLog as 'down' (non-200), but registry process read the IAM creds
// Alternative internal target:
// healthCheckUrl: "http://10.0.0.5:9090/metrics"
// Worker fetches Prometheus metrics → JVM heap, DB query durations, error rates exposed
Scheduled SSRF amplification: Unlike one-shot import SSRF (SA-SKL-SSRF18), health-check SSRF fires repeatedly on a schedule. Even if the attacker cannot read the response directly, the registry process reads every credential response. If any part of the response body is logged (for debugging uptime check failures), the logs contain live IAM credentials that rotate every few hours. Treat scheduled fetch jobs with the same SSRF controls as on-demand fetch endpoints.
The fix resolves the hostname to an IP address before fetching and blocks the request if the resolved IP falls in any private, loopback, or link-local range. The check must happen post-resolution to defeat DNS rebinding — a DNS server that returns a valid public IP during registration but switches to an internal IP when the worker resolves it at poll time. Using a short DNS TTL enforcement window, or re-validating the IP on every poll cycle, closes this window.
// FIXED — DNS IP check before health check fetch
const dns = 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 lives here
'::1/128', 'fc00::/7', 'fe80::/10' // IPv6 equivalents
];
async function checkSkillHealth(skill) {
const parsed = new URL(skill.healthCheckUrl);
if (parsed.protocol !== 'https:') {
throw new Error('healthCheckUrl must use HTTPS');
}
// Resolve every poll cycle to prevent DNS rebinding
const { address } = await dns.lookup(parsed.hostname, { family: 4 });
if (ipRangeCheck(address, BLOCKED_RANGES)) {
throw new Error(`healthCheckUrl resolves to blocked range: ${address}`);
}
const res = await fetch(skill.healthCheckUrl, {
redirect: 'error', // reject HTTP redirects — may point to internal target
signal: AbortSignal.timeout(3000)
});
skill.status = res.ok ? 'up' : 'down';
await db.uptimeLog.insert({ skillId: skill.id, status: skill.status, checkedAt: Date.now() });
}
SSRF19-002 — Skill webhook notification URL accepts any HTTP/HTTPS URL
When significant events occur — an audit completes, a new skill version is published, or a billing threshold is crossed — the registry POSTs a JSON event payload to the developer's configured webhookUrl. The webhook URL is stored at skill registration time and later used by an event dispatch worker. Without SSRF validation, an attacker sets their webhook to an internal Kibana instance's saved objects API. When the registry fires a webhook POST, the request body (a well-formed JSON event object) is submitted to Kibana's API, which may inadvertently create index patterns or saved searches. More critically, Kibana's API response — which may contain index metadata, dashboard configurations, and internal cluster information — is returned to the event dispatch worker and reflected in the webhook delivery receipt stored in the registry database.
// VULNERABLE — webhook event dispatch
async function dispatchWebhookEvent(org, event) {
await fetch(org.webhookUrl, { // <-- no SSRF check
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(event)
});
}
// Attacker webhook configuration:
// webhookUrl: "http://10.0.0.10:5601/api/saved_objects/index-pattern"
// Event dispatch POSTs:
// { "type": "audit.complete", "skillId": "...", "result": "passed", "timestamp": "..." }
// Kibana interprets the JSON body as a saved-object create request
// Kibana API response (index-pattern list) is read by dispatch worker
Validate at registration, re-validate at dispatch: SSRF validation on webhook URLs should occur at two points: when the developer configures the URL (to reject obviously internal hostnames), and again at dispatch time (to catch DNS rebinding). The registration-time check catches typos and misconfiguration; the dispatch-time check handles the rebinding attack where a hostname resolves to an internal IP only after registration has completed. Both checks should use DNS resolution, not just hostname string matching.
// FIXED — DNS IP check + HTTPS + reject redirects at dispatch
async function validateWebhookUrl(webhookUrl) {
const parsed = new URL(webhookUrl);
if (parsed.protocol !== 'https:') {
throw new Error('Webhook URL must use HTTPS');
}
const { address } = await dns.lookup(parsed.hostname, { family: 4 });
if (ipRangeCheck(address, BLOCKED_RANGES)) {
throw new Error(`Webhook URL resolves to blocked range: ${address}`);
}
return true; // safe to store / dispatch
}
async function dispatchWebhookEvent(org, event) {
// Re-validate at dispatch time to catch DNS rebinding
await validateWebhookUrl(org.webhookUrl);
await fetch(org.webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(event),
redirect: 'error', // never follow redirects that may target internal hosts
signal: AbortSignal.timeout(10000)
});
}
SSRF19-003 — Skill CI/CD integration fetches pipeline status from developer-supplied URL
MCP skill registry listing pages show a build status badge — "passing" or "failing" — sourced from the developer's CI/CD pipeline. The developer configures a pipelineStatusUrl pointing to their CI provider's status API. The registry worker fetches this URL on a schedule and parses the response to update the badge. Because CI providers have fixed, well-known hostnames, the correct defense is a strict allowlist of approved CI provider API hostnames. An attacker who sets pipelineStatusUrl to their internal Jenkins instance's API endpoint (http://internal-jenkins:8080/job/deploy-prod/api/json) receives a response containing Jenkins job parameters, last build trigger details, build artifacts, and environment variable names from the production deployment pipeline — information that significantly aids lateral movement.
// VULNERABLE — CI pipeline badge fetch
async function updatePipelineBadge(skill) {
const badge = await fetch(skill.pipelineStatusUrl) // <-- no hostname validation
.then(r => r.json());
skill.buildStatus = badge.result === 'SUCCESS' ? 'passing' : 'failing';
await db.skills.update({ id: skill.id, buildStatus: skill.buildStatus });
}
// Attacker configuration:
// pipelineStatusUrl: "http://internal-jenkins:8080/job/deploy-prod/api/json"
// Worker fetches → {
// "result": "SUCCESS",
// "actions": [{ "_class": "...", "parameters": [{ "name": "DEPLOY_ENV", "value": "production" }] }],
// "artifacts": [{ "fileName": "deploy.sh", "relativePath": "scripts/deploy.sh" }]
// }
Allowlist beats blocklist for known providers: For CI/CD pipeline status URLs, the set of supported providers is small and fixed. An allowlist of exact hostnames (api.github.com, gitlab.com, etc.) is simpler to implement, easier to audit, and impossible to bypass compared to IP-range blocklisting. If a new CI provider needs to be added, it requires an explicit code change — which is the right security gate for expanding trusted fetch targets.
// FIXED — hostname allowlist for CI provider fetch
const ALLOWED_CI_HOSTS = new Set([
'api.github.com',
'gitlab.com',
'circleci.com',
'api.travis-ci.com',
'app.bitbucket.org',
'dev.azure.com',
'api.buildkite.com'
]);
async function updatePipelineBadge(skill) {
const parsed = new URL(skill.pipelineStatusUrl);
if (parsed.protocol !== 'https:') {
throw new Error('pipelineStatusUrl must use HTTPS');
}
// Allowlist check — reject any hostname not in the known CI provider set
if (!ALLOWED_CI_HOSTS.has(parsed.hostname)) {
throw new Error(`CI provider hostname not allowed: ${parsed.hostname}`);
}
const response = await fetch(skill.pipelineStatusUrl, {
redirect: 'error',
signal: AbortSignal.timeout(5000)
});
const badge = await response.json();
skill.buildStatus = badge.result === 'SUCCESS' ? 'passing' : 'failing';
await db.skills.update({ id: skill.id, buildStatus: skill.buildStatus });
}
SSRF19-004 — Skill screenshot/preview URL fetched by Puppeteer for OG image generation
When a developer publishes a skill, the registry generates a social preview image — the OG image used when the skill listing page is shared on Slack, Twitter, or LinkedIn. This is implemented via a Puppeteer worker that navigates to the skill's previewUrl, takes a screenshot, and stores it in the CDN. The previewUrl is supplied by the developer. Unlike a simple fetch() call, Puppeteer renders the full page including JavaScript — making the attack surface larger. An attacker sets previewUrl to http://localhost:3001/admin; the Puppeteer worker renders the registry's internal admin panel (which trusts localhost requests), and the screenshot stored in the CDN is a full rendering of the admin dashboard. If the registry is on EC2, setting previewUrl to http://169.254.169.254/latest/meta-data/ causes Puppeteer to render the metadata service's plaintext directory listing as an image.
// VULNERABLE — Puppeteer OG image worker
async function generatePreviewImage(skill) {
const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
const page = await browser.newPage();
await page.goto(skill.previewUrl); // <-- no SSRF check; Puppeteer renders any URL
const screenshot = await page.screenshot({ type: 'png', clip: { x: 0, y: 0, width: 1200, height: 630 } });
await browser.close();
await cdn.put(`previews/${skill.id}.png`, screenshot);
}
// Attacker sets:
// previewUrl: "http://localhost:3001/admin"
// → Puppeteer renders the registry's own admin panel (trusted on 127.0.0.1)
// → Screenshot stored as CDN asset — full admin UI captured
// Alternative:
// previewUrl: "http://169.254.169.254/latest/meta-data/"
// → Puppeteer renders EC2 metadata directory listing as OG image
Puppeteer request interception is mandatory: A DNS IP check on the initial previewUrl hostname is necessary but not sufficient for Puppeteer. During page rendering, JavaScript on the target page may issue sub-requests (XHR, fetch, resource loads) to additional internal URLs. Puppeteer's request interception API (page.setRequestInterception(true)) must intercept and validate every outgoing request during the render, not just the initial navigation. Any request whose resolved IP falls in a blocked range must be aborted before Puppeteer sends it.
// FIXED — DNS IP check before goto() + Puppeteer request interception
async function generatePreviewImage(skill) {
const parsed = new URL(skill.previewUrl);
if (parsed.protocol !== 'https:') {
throw new Error('previewUrl must use HTTPS');
}
// DNS IP check on the top-level URL before launching Puppeteer
const { address } = await dns.lookup(parsed.hostname, { family: 4 });
if (ipRangeCheck(address, BLOCKED_RANGES)) {
throw new Error(`previewUrl resolves to blocked range: ${address}`);
}
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
const page = await browser.newPage();
// Intercept all requests during rendering — block internal IPs
await page.setRequestInterception(true);
page.on('request', async (req) => {
try {
const reqParsed = new URL(req.url());
if (!['https:'].includes(reqParsed.protocol)) {
req.abort('blockedbyclient');
return;
}
const { address: reqAddr } = await dns.lookup(reqParsed.hostname, { family: 4 });
if (ipRangeCheck(reqAddr, BLOCKED_RANGES)) {
req.abort('blockedbyclient');
return;
}
} catch {
req.abort('blockedbyclient');
return;
}
req.continue();
});
await page.goto(skill.previewUrl, { waitUntil: 'networkidle2', timeout: 15000 });
const screenshot = await page.screenshot({ type: 'png', clip: { x: 0, y: 0, width: 1200, height: 630 } });
await browser.close();
await cdn.put(`previews/${skill.id}.png`, screenshot);
}
Detection summary
| Finding | Severity | Attack surface | Fix |
|---|---|---|---|
| SSRF19-001 | CRITICAL | Health check URL monitor | DNS IP check per poll cycle + HTTPS + no-redirect |
| SSRF19-002 | CRITICAL | Webhook notification dispatch | DNS IP check at registration and dispatch + HTTPS + reject redirects |
| SSRF19-003 | HIGH | CI/CD pipeline status badge | Allowlist of CI provider hostnames — reject all others |
| SSRF19-004 | CRITICAL | Puppeteer OG preview render | DNS IP check before goto() + request interception for all sub-requests |
SkillAudit scans MCP skill registry codebases for all four SSRF19 patterns. Scheduled fetch jobs, event dispatch workers, and headless browser render workers that consume developer-supplied URLs without DNS IP validation each trigger a CRITICAL SSRF finding. See also SA-SKL-SSRF18 for SSRF via skill manifest and icon URL fetching, and SA-SKL-SSRF17 for SSRF via PDF generation service URL parameters.