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

How to fix: Webhook/Callback URL Configured to a Private Address

A JSON response field or HTML form field named with 'webhook' or 'callback' is currently set to a URL whose host is a private IP range (RFC 1918), loopback, link-local address (including the 169.254.169.254 cloud metadata endpoint), or a .local/.internal/.lan name. The field's live value, not just source code, is exposed in the response.

Why it matters

A webhook feature that accepts and stores a private-range destination has no host-range validation on save. When the server later fires that webhook, it makes an outbound request from inside your network to whatever internal service, admin panel, or cloud metadata endpoint the value points to, handing an attacker a way to read instance credentials or reach infrastructure with no public exposure.

This only fires on the field's currently exposed value (from a settings API response or a rendered form's value attribute), not a code pattern, so it is direct evidence the private-range value was accepted. It does not by itself prove an external attacker supplied the value: an internal admin could have configured it intentionally. Treat it as confirmation that the save path lacks IP-range validation, and verify manually whether the field is reachable by untrusted users.

How to fix it

  1. 1Validate webhook/callback URLs at save time: resolve the hostname and reject private, loopback, and link-local ranges.
  2. 2Re-validate on every delivery attempt, not only at registration, since DNS can change between save and send.
  3. 3Block the cloud metadata address (169.254.169.254 and equivalents) explicitly regardless of other range checks.
  4. 4If internal callback destinations are a legitimate product need, require them to be explicitly allowlisted per integration rather than accepted from any user input.

Code examples

Reject private-range webhook destinations on save

TypeScript
import { isIP } from 'net';

function isPrivateHost(hostname: string): boolean {
  if (hostname === 'localhost') return true;
  if (isIP(hostname) === 4) {
    return /^(127\.|10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|169\.254\.|0\.)/.test(hostname);
  }
  return false; // resolve + check AAAA/loopback separately for full IPv6 coverage
}

function saveWebhookUrl(url: string) {
  const { hostname } = new URL(url);
  if (isPrivateHost(hostname)) throw new Error('Private/internal webhook targets are not allowed');
}

References

Detected automatically by VulnRadar. The check id is webhook-callback-private-ip-target, stable across every scan so you can filter or diff on it.

See every host validation check

Questions

How severe is Webhook/Callback URL Configured to a Private Address?
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-callback-private-ip-target, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Webhook/Callback URL Configured to a Private Address 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/callback url configured to a private address

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/Callback URL Configured to a Private Address | VulnRadar