Claude skill SSRF via webhook delivery and scheduled job URL fetch — SA-SKL-SSRF10
Most SSRF mitigations focus on immediate request paths — the user submits a URL and the server fetches it in the same HTTP transaction. SA-SKL-SSRF10 covers the harder category: SSRF via asynchronous URL fetch, where the malicious URL is stored at configuration time and executed minutes or hours later by a background job, webhook delivery worker, or health-check scheduler. These patterns are harder to test manually, often run with elevated internal network access, and frequently bypass IP denylists because they resolve DNS at job execution time, not at configuration time.
Async SSRF in MCP skill deployments
An MCP skill audit platform has three natural async URL fetch surfaces: webhook delivery (the platform POSTs audit results to a user-configured endpoint), scheduled content jobs (the platform polls RSS feeds or badge URLs on a schedule), and audit result callbacks (the platform notifies a CI system when an audit completes). All three accept a URL at configuration time from an authenticated user, store it, and later fetch it without the user present. The key difference from synchronous SSRF is that the IP check at configuration time can be bypassed with DNS rebinding — the domain resolves to a legitimate external IP when configured and rebinds to an internal IP at fetch time. SA-SKL-SSRF10 covers the full set: direct internal IP, file:// scheme, redirect chain to IMDS, and HTTP CONNECT proxy.
http://10.0.0.1:8080/admin; each audit result delivery probes internal servicesfile:///etc/passwd; file contents returned as parsed XML or error body169.254.169.254/latest/meta-data/; AWS IMDS credential exfilSSRF10-001 — webhook POST to user-configured URL without IP validation
Webhook delivery workers run in the same VPC as the MCP skill's internal services. When a user configures a webhook endpoint, the worker saves the URL and later sends POST requests to it on each audit completion. Without per-delivery IP range validation, an attacker who controls a free account can set their webhook URL to http://10.0.0.1:8080/admin and receive a POST with the audit result body on every audit. More critically, the POST body from the platform carries a JWT or HMAC signature that the internal admin service may trust. IP range validation must run at delivery time (not just at configuration time) to defeat DNS rebinding — the domain must be resolved and the resulting IP checked against the denylist on each delivery attempt.
// VULNERABLE — webhook delivery without IP validation
async function deliverWebhook(webhookUrl, payload) {
// VULNERABLE: no IP check; attacker sets webhookUrl = http://10.0.0.1:8080/admin
const resp = await fetch(webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-SkillAudit-Signature': sign(payload) },
body: JSON.stringify(payload),
signal: AbortSignal.timeout(30_000),
});
return resp.status;
}
// FIXED — DNS-based IP range check on each delivery + 10s timeout
import dns from 'dns/promises';
import ipRangeCheck from 'ip-range-check'; // npm: ip-range-check
const BLOCKED_RANGES = [
'10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16',
'127.0.0.0/8', '169.254.0.0/16', // IMDS
'100.64.0.0/10', // CGNAT
'::1/128', 'fc00::/7', 'fe80::/10',
];
async function checkUrlSafe(urlString) {
const url = new URL(urlString);
if (!['http:', 'https:'].includes(url.protocol)) throw new Error('Non-HTTP protocol rejected');
const addrs = await dns.resolve4(url.hostname).catch(() => []);
const addrs6 = await dns.resolve6(url.hostname).catch(() => []);
for (const ip of [...addrs, ...addrs6]) {
if (ipRangeCheck(ip, BLOCKED_RANGES)) throw new Error(`Blocked IP range: ${ip}`);
}
}
async function deliverWebhook(webhookUrl, payload) {
await checkUrlSafe(webhookUrl); // validate on each delivery — defeats DNS rebinding
const resp = await fetch(webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-SkillAudit-Signature': sign(payload) },
body: JSON.stringify(payload),
signal: AbortSignal.timeout(10_000), // 10s — not 30s; don't hold worker threads
redirect: 'error', // never follow redirects on webhook delivery
});
return resp.status;
}
SSRF10-002 — Scheduled RSS job fetches file:// URI from user config
An MCP skill platform that monitors badge or RSS feed URLs for skill authors runs a scheduled poller that fetches each stored URL every hour. The URL is validated at the time the user saves it in their profile settings, but the validation checks only that the URL is well-formed — it does not check the scheme. An attacker sets their feed URL to file:///etc/passwd. When the poller runs, the fetch library resolves the file:// URI using the OS file read path and returns the file contents as the response body. The poller stores the first 300 KB of the response as the feed cache — which is now the contents of /etc/passwd, readable via the API. The fix is to enforce https://-only schemes and apply a DNS IP range check before each scheduled fetch, in addition to a strict response size limit.
// VULNERABLE — RSS poller fetches user-configured URL with any scheme
async function pollFeed(feedUrl) {
// VULNERABLE: feedUrl can be file:///etc/passwd, ftp://, gopher://, etc.
const resp = await fetch(feedUrl, { signal: AbortSignal.timeout(15_000) });
const text = await resp.text();
await cacheFeedContent(feedUrl, text.slice(0, 300_000));
}
// FIXED — https:// only + DNS IP check + 300KB limit + 10s timeout
async function pollFeed(feedUrl) {
const url = new URL(feedUrl);
// Reject non-https schemes before DNS resolution
if (url.protocol !== 'https:') throw new Error(`Rejected scheme: ${url.protocol}`);
// DNS IP range check on each poll — defeats DNS rebinding
await checkUrlSafe(feedUrl); // same helper as SSRF10-001
const resp = await fetch(feedUrl, {
method: 'GET',
signal: AbortSignal.timeout(10_000),
redirect: 'follow',
headers: { 'User-Agent': 'SkillAudit-FeedPoller/1.0' },
});
// Enforce strict response size — do not buffer entire body
const reader = resp.body.getReader();
const MAX_BYTES = 300 * 1024;
let received = 0;
const chunks = [];
while (true) {
const { done, value } = await reader.read();
if (done) break;
received += value.length;
if (received > MAX_BYTES) {
await reader.cancel();
break;
}
chunks.push(value);
}
const text = Buffer.concat(chunks).toString('utf8');
await cacheFeedContent(feedUrl, text);
}
SSRF10-003 — Audit callback URL follows redirect chain to IMDS
When an MCP skill audit completes, the platform POSTs a result notification to the user-configured callback URL. The notification uses fetch with its default redirect behavior (redirect: 'follow'), following up to 20 redirects. An attacker who controls the callback URL endpoint can configure it to respond with a 301 redirect pointing to http://169.254.169.254/latest/meta-data/iam/security-credentials/. The fetch follows the redirect to the IMDS endpoint (which is accessible from any process running on an EC2 instance), and returns the AWS role credentials in the POST response body. Those credentials are logged by the worker's error handler when the target rejects the POST method. The fix is to set redirect: 'error' on webhook delivery — never follow redirects from user-configured URLs.
// VULNERABLE — fetch with default redirect:follow on callback URL
async function sendAuditCallback(callbackUrl, auditResult) {
// VULNERABLE: redirect:'follow' (default) — attacker's server responds 301 → 169.254.169.254
const resp = await fetch(callbackUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(auditResult),
signal: AbortSignal.timeout(30_000), // 30s timeout; redirect chain completes
});
if (!resp.ok) {
const body = await resp.text(); // logs IMDS credential response on error
logger.error({ callbackUrl, body }, 'Callback failed');
}
}
// FIXED — redirect:'error' + IP check + no response body logging on failure
async function sendAuditCallback(callbackUrl, auditResult) {
await checkUrlSafe(callbackUrl); // DNS IP range check per delivery
const resp = await fetch(callbackUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(auditResult),
signal: AbortSignal.timeout(10_000),
redirect: 'error', // never follow redirects on callbacks
});
if (!resp.ok) {
// Log only the status code — never the response body (may be IMDS data)
logger.warn({ callbackUrl: maskUrl(callbackUrl), status: resp.status }, 'Callback non-2xx');
}
}
function maskUrl(urlString) {
try {
const u = new URL(urlString);
return `${u.protocol}//${u.hostname}${u.pathname}`;
} catch { return '[invalid url]'; }
}
SSRF10-004 — Health check via HTTP CONNECT proxy to arbitrary host:port
An MCP skill platform feature that lets users verify their webhook endpoint is reachable may implement the check by sending an HTTP CONNECT request from the platform's Node.js HTTP client to the user's domain. HTTP CONNECT is designed for HTTPS proxy tunneling — the proxy establishes a TCP connection to the target host:port and forwards bytes in both directions. If the platform's HTTP client accepts CONNECT requests and forwards them, an attacker can use it as a proxy to reach any internal host:port combination by supplying a hostname that resolves to an internal IP. This bypasses the normal IP-range check because the CONNECT target is not fetched by the platform — the platform just tunnels TCP. The fix is to never use HTTP CONNECT for user-configured URLs; use a standard GET request to validate reachability, with the full DNS IP range check applied.
// VULNERABLE — CONNECT method used for reachability check; tunnels to any host:port
async function checkWebhookReachable(webhookUrl) {
const url = new URL(webhookUrl);
// VULNERABLE: HTTP CONNECT tunnels TCP to url.host — bypasses IP range check
// Attacker sets webhookUrl=https://10.0.0.1:8080/ — CONNECT establishes TCP to 10.0.0.1:8080
const proxyResp = await httpClient.connect(`${url.hostname}:${url.port || 443}`);
return proxyResp.statusCode === 200;
}
// FIXED — standard GET + DNS IP check; no CONNECT
async function checkWebhookReachable(webhookUrl) {
const url = new URL(webhookUrl);
if (url.protocol !== 'https:') throw new Error('Only https:// webhook URLs accepted');
await checkUrlSafe(webhookUrl); // DNS IP range check
// Use GET (not CONNECT or HEAD) to verify endpoint is reachable
// HEAD may be rejected by some webhook receivers; GET with small body is safer
const resp = await fetch(webhookUrl, {
method: 'GET',
signal: AbortSignal.timeout(5_000),
redirect: 'error', // no redirects
headers: { 'X-SkillAudit-Ping': '1' },
});
// Any HTTP response (including 4xx/5xx) means endpoint is reachable
return { reachable: true, status: resp.status };
}
Related patterns: DNS-based IP check patterns are covered in depth in SA-SKL-SSRF9: PDF and headless browser SSRF. For redirect-chain SSRF on the synchronous audit submission path, see SA-SKL-SSRF8: DNS rebinding TOCTOU. The headless SSRF blog post covers the full IMDS credential exfil chain via browser rendering in MCP audits.
| Finding | Severity | Vulnerable pattern | Fix |
|---|---|---|---|
SSRF10-001 | Critical | Webhook POST to user-configured URL; no IP range check per delivery; internal network probe | DNS IP range check on each delivery; redirect:'error'; 10s timeout |
SSRF10-002 | Critical | Scheduled RSS poller fetches file:// URI from user config; file contents in cache | https:// scheme check + DNS IP range check + 300KB response cap per poll |
SSRF10-003 | High | Audit callback follows 301/302 chain to IMDS; role credentials in response body logged | redirect:'error' on all callback fetches; never log response body on failure |
SSRF10-004 | High | Health check via HTTP CONNECT proxy to user domain; tunnels TCP to internal host:port | Reject CONNECT; use GET + DNS IP range check; https:// only; redirect:'error' |