Claude MCP skill SSRF — external integration and third-party service configuration endpoints
jiraBaseUrl for ticket creation; attacker sets to 169.254.169.254; IAM creds included in Jira API error response logged to audit trailslackWebhookUrl for delivery confirmation; attacker sets to 10.0.0.1:9200 Elasticsearch; cluster health response parsed as Slack API response; index names in audit logpdApiUrl for alert delivery; attacker sets to internal alertmanager:9093; alert routing config returned in integration test responsegithubApiUrl for repo permissions; attacker sets to internal GitHub Enterprise; internal org and repo names in permissions responseSSRF30-001 — Jira integration SSRF via user-supplied base URL
The Jira integration allows users to configure a Jira base URL for automatic ticket creation on audit findings. The integration endpoint uses fetch(`${jiraBaseUrl}/rest/api/3/issue`, { ... }) with the user-supplied URL. When the attacker sets jiraBaseUrl to http://169.254.169.254/latest/meta-data/iam/security-credentials/prod-role, the fetch returns the IAM credentials. The error handler logs the full response body as a "Jira API error" in the audit trail, which is accessible to the user via the audit report UI.
// SSRF30-001 — VULNERABLE
router.post('/integrations/jira/test', requireSession, async (req, res) => {
const { jiraBaseUrl, projectKey, apiToken } = req.body;
// No SSRF guard — fetches any URL the user provides
const response = await fetch(`${jiraBaseUrl}/rest/api/3/issue`, {
method: 'POST',
headers: { Authorization: `Bearer ${apiToken}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ fields: { project: { key: projectKey }, summary: 'SkillAudit test' } }),
});
if (!response.ok) {
const body = await response.text();
logger.error({ jiraBaseUrl, status: response.status, body }, 'Jira API error'); // IMDS creds logged
return res.status(502).json({ error: 'Jira integration test failed', detail: body });
}
res.json({ ok: true });
});
// SSRF30-001 — FIXED
const dns = require('dns').promises;
const { isPrivateIp } = require('../utils/ssrf-guard');
const JIRA_CLOUD_HOSTNAMES = /^[a-z0-9-]+\.atlassian\.net$/;
const JIRA_SELF_HOSTED_ALLOWLIST = new Set((process.env.ALLOWED_JIRA_HOSTS || '').split(',').filter(Boolean));
async function validateJiraBaseUrl(url) {
const parsed = new URL(url); // throws on invalid URL
if (parsed.protocol !== 'https:') throw new Error('HTTPS only');
if (!JIRA_CLOUD_HOSTNAMES.test(parsed.hostname) && !JIRA_SELF_HOSTED_ALLOWLIST.has(parsed.hostname)) {
throw new Error('Jira hostname not in allowlist');
}
// Resolve hostname and block private IPs
const { address } = await dns.lookup(parsed.hostname);
if (isPrivateIp(address)) throw new Error('Resolved to private IP');
return parsed;
}
router.post('/integrations/jira/test', requireSession, async (req, res) => {
const { jiraBaseUrl, projectKey, apiToken } = req.body;
try {
await validateJiraBaseUrl(jiraBaseUrl);
} catch (e) {
return res.status(422).json({ error: `Invalid Jira URL: ${e.message}` });
}
const response = await fetch(`${jiraBaseUrl}/rest/api/3/issue`, {
method: 'POST',
headers: { Authorization: `Bearer ${apiToken}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ fields: { project: { key: projectKey }, summary: 'SkillAudit test' } }),
redirect: 'error', // prevent open redirects to internal URLs
});
if (!response.ok) {
// Log only status code — never log response body from external services
logger.warn({ jiraBaseUrl, status: response.status }, 'Jira integration test failed');
return res.status(502).json({ error: 'Jira integration test failed' });
}
res.json({ ok: true });
});
SSRF30-002 — Slack webhook URL SSRF exposing internal Elasticsearch
The Slack notification integration stores a user-supplied webhook URL and fires a POST to it when audits complete. During the integration setup, the endpoint sends a test message to confirm the URL is reachable and returns the HTTP response status to the user. When the attacker sets slackWebhookUrl to http://10.0.0.1:9200/_cluster/health, the response is a JSON object from the internal Elasticsearch cluster health endpoint. The setup confirmation UI displays the parsed response body as a "Slack API response", leaking cluster status, node counts, and index names.
// SSRF30-002 — VULNERABLE
router.post('/integrations/slack/setup', requireSession, async (req, res) => {
const { slackWebhookUrl } = req.body;
// No hostname check — fetches any URL
const testResponse = await fetch(slackWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'SkillAudit connected ✓' }),
});
const body = await testResponse.json();
res.json({ connected: testResponse.ok, slackResponse: body }); // internal service response returned
});
// SSRF30-002 — FIXED
// Slack webhook URLs must match hooks.slack.com pattern. Never return response bodies.
const SLACK_WEBHOOK_RE = /^https:\/\/hooks\.slack\.com\/services\/[A-Z0-9\/]+$/;
router.post('/integrations/slack/setup', requireSession, async (req, res) => {
const { slackWebhookUrl } = req.body;
if (!SLACK_WEBHOOK_RE.test(slackWebhookUrl)) {
return res.status(422).json({ error: 'slackWebhookUrl must be a valid hooks.slack.com URL' });
}
const testResponse = await fetch(slackWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'SkillAudit integration test' }),
redirect: 'error',
});
// Return only the status — never return the response body from external URLs
res.json({ connected: testResponse.ok });
});
SSRF30-003 — PagerDuty API URL SSRF exposing internal alertmanager
The PagerDuty integration endpoint sends audit severity alerts to the user-supplied pdApiUrl. This was designed to support PagerDuty's self-hosted offering and staging environments. The endpoint fetches the URL with the user's PagerDuty routing key in the authorization header and returns the parsed response body as the integration test result. When the attacker sets pdApiUrl to http://alertmanager.internal:9093/api/v2/alerts, the GET response from the internal Prometheus Alertmanager is parsed and returned to the attacker as the "PagerDuty test result", revealing alert routing configuration, silence rules, and inhibit configurations.
// SSRF30-003 — VULNERABLE
router.post('/integrations/pagerduty/test', requireSession, async (req, res) => {
const { pdApiUrl, routingKey } = req.body;
// No hostname check — user controls the target URL
const r = await fetch(`${pdApiUrl}/v2/enqueue`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Routing-Key': routingKey },
body: JSON.stringify({ payload: { summary: 'SkillAudit test', severity: 'info' } }),
});
res.json({ status: r.status, body: await r.json() }); // internal service response returned
});
// SSRF30-003 — FIXED
const PD_HOSTNAME_ALLOWLIST = new Set([
'events.pagerduty.com',
'events.eu.pagerduty.com',
]);
router.post('/integrations/pagerduty/test', requireSession, async (req, res) => {
const { pdApiUrl, routingKey } = req.body;
let parsed;
try {
parsed = new URL(`${pdApiUrl}/v2/enqueue`);
if (parsed.protocol !== 'https:') throw new Error('HTTPS only');
if (!PD_HOSTNAME_ALLOWLIST.has(parsed.hostname)) throw new Error('Hostname not in allowlist');
} catch (e) {
return res.status(422).json({ error: `Invalid PagerDuty URL: ${e.message}` });
}
const r = await fetch(parsed.toString(), {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Routing-Key': routingKey },
body: JSON.stringify({ payload: { summary: 'SkillAudit test', severity: 'info' } }),
redirect: 'error',
});
// Return only success/failure — never return body from external service
res.json({ connected: r.status === 202 });
});
SSRF30-004 — GitHub App API URL SSRF exposing internal GitHub Enterprise
The GitHub App integration verifies installation by fetching repository permissions from the GitHub API. The endpoint accepts a user-supplied githubApiUrl to support GitHub Enterprise Server customers. The fetch includes the installation token in the Authorization header and returns the permissions JSON to the UI. When the attacker sets githubApiUrl to their internal GitHub Enterprise instance, the internal org structure, private repository names, team names, and user accounts are returned as the installation verification response.
// SSRF30-004 — VULNERABLE
router.post('/integrations/github/verify', requireSession, async (req, res) => {
const { githubApiUrl, installationToken, repoFullName } = req.body;
// attacker sets githubApiUrl to internal GitHub Enterprise
const r = await fetch(`${githubApiUrl}/repos/${repoFullName}`, {
headers: { Authorization: `Bearer ${installationToken}`, Accept: 'application/vnd.github+json' },
});
const repo = await r.json(); // internal GHE response with org/repo names returned
res.json({ connected: r.ok, permissions: repo.permissions });
});
// SSRF30-004 — FIXED
const GITHUB_API_ALLOWLIST = new Set([
'api.github.com',
// Add specific GHE hostnames via environment variable
...(process.env.ALLOWED_GHE_HOSTS || '').split(',').filter(Boolean),
]);
router.post('/integrations/github/verify', requireSession, async (req, res) => {
const { githubApiUrl, installationToken, repoFullName } = req.body;
let parsed;
try {
parsed = new URL(githubApiUrl);
if (parsed.protocol !== 'https:') throw new Error('HTTPS only');
if (!GITHUB_API_ALLOWLIST.has(parsed.hostname)) throw new Error('GitHub API hostname not in allowlist');
} catch (e) {
return res.status(422).json({ error: `Invalid GitHub API URL: ${e.message}` });
}
const r = await fetch(`${parsed.origin}/repos/${repoFullName}`, {
headers: { Authorization: `Bearer ${installationToken}`, Accept: 'application/vnd.github+json' },
redirect: 'error',
});
if (!r.ok) return res.json({ connected: false });
const repo = await r.json();
// Return only the permissions subset — not the full repo object
res.json({ connected: true, permissions: { pull: repo.permissions?.pull, push: repo.permissions?.push } });
});
Hardening summary
| Finding | Pattern | Fix |
|---|---|---|
| SSRF30-001 | Jira base URL fetched without hostname validation | Hostname allowlist + DNS private IP block; never log response bodies |
| SSRF30-002 | Slack webhook URL fetched and response returned to caller | Strict hooks.slack.com regex; return only HTTP status, not response body |
| SSRF30-003 | PagerDuty API URL fetched with routing key in auth header | Explicit PD hostname allowlist; redirect:error; return only success boolean |
| SSRF30-004 | GitHub API URL fetched with installation token | Hostname allowlist from env var for GHE; return only permissions subset |
Related: SA-SKL-SSRF29, SA-SKL-SSRF28. Run SkillAudit to surface all SSRF30 patterns in your MCP skill registry.