Skip to main content
MediumHost validationOWASP A10:2021CWE-918

How to fix: Webhook URL From Request Passed to Outbound Call Unvalidated

Source text in the response shows a webhook/callback URL variable assigned directly from request input (req.body, req.query, req.params, or similar) and passed to an outbound HTTP client (fetch, axios, got, superagent, request) shortly after, with no private-IP or allowlist validation keyword found anywhere between the two.

Why it matters

If this shape reflects the server's real code path, an attacker who controls the webhook/callback URL (via a registration form, integration settings, or a test/ping endpoint) can point it at internal services, cloud metadata endpoints, or other infrastructure the public internet cannot otherwise reach, and have your own server make the request on their behalf.

The check requires both halves of the pattern: a webhook/callback-named variable sourced from req./request./body./params./query., and an outbound HTTP call syntactically nearby, with no mention of private/internal/loopback/localhost/isPrivateIP/isPrivateHostname/blocklist/denylist/allowlist/whitelist/allowed_hosts/ssrf in between. A doc/tutorial page rendering the same snippet as literal example text inside <pre>/<code> is excluded. Because this reads response text rather than executing the code, it cannot confirm the validation genuinely runs before the fetch, only that no such check is visible in the surrounding text: treat it as a prompt to review the real request-handling code.

How to fix it

  1. 1Resolve the webhook/callback hostname and reject private, loopback, and link-local ranges before making the outbound request.
  2. 2Re-check on every delivery, since the destination can be changed after initial validation and DNS can change between checks.
  3. 3Route webhook deliveries through an egress proxy or allowlist rather than calling fetch/axios/got directly on user-supplied URLs.
  4. 4Disable HTTP redirects on the outbound client or re-validate the destination after each redirect hop.

Code examples

Validate before delivering a webhook

TypeScript
// Bad: no validation between the request value and the outbound call
const webhookUrl = req.body.webhookUrl;
await fetch(webhookUrl, { method: 'POST', body: JSON.stringify(payload) });

// Good: validate the destination first
const webhookUrl = req.body.webhookUrl;
const { hostname, protocol } = new URL(webhookUrl);
if (protocol !== 'https:' || isPrivateHostname(hostname)) {
  throw new Error('Webhook destination not allowed');
}
await fetch(webhookUrl, { method: 'POST', body: JSON.stringify(payload), signal: AbortSignal.timeout(5_000) });

References

Detected automatically by VulnRadar. The check id is webhook-ssrf-request-input-no-validation, stable across every scan so you can filter or diff on it.

See every host validation check

Questions

How severe is Webhook URL From Request Passed to Outbound Call Unvalidated?
VulnRadar rates this medium severity in the host validation category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id webhook-ssrf-request-input-no-validation, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Webhook URL From Request Passed to Outbound Call Unvalidated map to?
It maps to CWE-918. In the OWASP Top 10 it falls under A10:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for webhook url from request passed to outbound call unvalidated

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Webhook URL From Request Passed to Outbound Call Unvalidated | VulnRadar