Skip to main content
Server-Side Request Forgery (SSRF) is a class of attack where an attacker tricks a service into making HTTP requests to internal addresses — cloud metadata endpoints, internal APIs, or localhost services — that should not be reachable from outside. HTTP buttons execute outbound HTTP requests. By default, Buttons blocks any request that resolves to a private network address.

Blocked address ranges

The following ranges are blocked by default:

Two enforcement points

A blocked target is caught at one of two places, depending on whether the URL’s host is a literal IP or a hostname. Literal IP, before any request. If the post-substitution URL’s host is a literal IP inside a blocked range, the press is refused before a connection is attempted. This surfaces as a VALIDATION_ERROR:
Hostname, at dial time. A hostname is resolved and every A/AAAA record is checked against the blocklist before the connection is dialed (see DNS rebinding below). A blocked address surfaces as a SCRIPT_ERROR:

DNS rebinding protection

Validation happens after DNS resolution, not just on the literal URL. This prevents DNS rebinding attacks, where a public hostname resolves to a private IP. The safe dialer resolves the hostname once, rejects the request if any resolved A/AAAA record lands in a blocked range, and then dials by the resolved IP rather than re-resolving the hostname. Dialing by the already-checked IP closes the rebinding window where an attacker returns a public IP on the first lookup and a private IP on the second. So if the hostname api.attacker.example resolves to 10.0.0.1 at press time, the request is blocked even though the URL does not look like a private address.

Escape hatch 1: per-button flag

To allow a specific button to target a private address, pass --allow-private-networks at create time. The flag applies only to HTTP (--url) buttons:
This flag is stored in the button spec and applies every time that button is pressed.
Only use --allow-private-networks for buttons that target infrastructure you control. A button with this flag in a shared environment gives any agent that can press it a path to your internal network.

Escape hatch 2: environment variable

To allow all HTTP buttons to target private networks in a given environment, set:
This is useful in local development or in isolated container networks where all traffic is internal by design.

Example: internal service in a container network

Or set the env var once in your container: