Skip to main content

isPrivateV4

@forge/monorepo


@forge/monorepo / backend/src / isPrivateV4

Function: isPrivateV4()

isPrivateV4(host): boolean

Defined in: backend/src/toolkit/ssrf.ts:71

Whether an IPv4 address is somewhere a fetch must not go.

Broader than "the RFC 1918 ranges", because the ranges that matter are the ones that reach something. In particular 100.64/10 (carrier-grade NAT) is where several hosting providers put internal services, and 0.0.0.0/8 is a well-known way of writing "this host" that a naive 127. check misses entirely.

Parameters

host

string

Returns

boolean