Home/Research/Post

GHSA-4qpf-57w4-m3wc: Symfony: Ip Constraint public/private Modes Accept IPv4-Mapped and IPv4-Compatible IPv6 Addresses: SSRF Filter Bypass

  • Severity: MEDIUM
  • CVE: CVE-2026-123125
  • Ecosystems: composer, composer, composer, composer, composer, composer, composer, composer
  • Packages: symfony/symfony, symfony/symfony, symfony/symfony, symfony/symfony, symfony/validator, symfony/validator, symfony/validator, symfony/validator

### Description

`Symfony\Component\Validator\Constraints\IpValidator` decides the public, private and reserved classification for the `Ip` constraint’s filtered modes solely from PHP’s `FILTER_FLAG_NO_PRIV_RANGE` and `FILTER_FLAG_NO_RES_RANGE` flags, with no second check.

Those flags are an incomplete basis for this purpose, in two ways.

**Whole ranges are covered by neither flag.** `100.64.0.0/10` (RFC 6598 shared address space, which is genuinely routed internal space), the TEST-NET ranges `192.0.2.0/24`, `198.51.100.0/24`, `203.0.113.0/24`, and `198.18.0.0/15` (RFC 2544 benchmarking) are accepted by every mode, as is the entire IPv6 special-purpose family: 6to4 (`2002::/16`), Teredo (`2001::/32`), NAT64 (`64:ff9b::/96`, `64:ff9b:1::/48`), documentation (`2001:db8::/32`) and benchmarking (`2001:0002::/48`).

**Classification is also spelling dependent for IPv6.** `::7f00:1` is accepted by every mode, while `::127.0.0.1`, the same 128 bits, is rejected by `NO_RES` from PHP 8.3 onward. PHP 8.3 added a reserved-range rule for `::ffff:0:0/96`, so `::ffff:127.0.0.1` is accepted on PHP 8.1 and 8.2 but rejected from 8.3, while the `::7f00:1` spelling and the `NO_PRIV` mode remain bypassed on every version up to 8.5.

A developer using `#[Assert\Ip(version: Ip::ALL_ONLY_PUBLIC)]` or `Ip::ALL_NO_PRIV` as an anti-internal-address guard is therefore bypassed. The strongest cases are IPv4-mapped addresses in `ALL_NO_PRIV` mode, and carrier-grade NAT space in the public-only modes. A…

Source: GitHub Security Advisories · 2026-12-01