Media

fastify vulnerable to X-Forwarded-* spoofing under trustProxy hop-count

  • Publicada: 02.09.2026
  • Actualizado: 11.10.2026 10:22

Impact

The fix for CVE-2026-3635 (GHSA-444r-cwp2-x5xf) added a proxyFn(socket.remoteAddress, 0) guard on the X-Forwarded-* reads in request.host, request.protocol, request.hostname, request.ip, and request.ips. That guard closes the IP, CIDR, and custom-function forms of trustProxy correctly because those forms compile to predicates that inspect the connecting address. The hop-count form (trustProxy: <number>) compiles to a predicate that structurally ignores the address argument, so the guard reduces to 0 < tp, always true for any tp >= 1.

Applications configured with trustProxy: <number> (documented as "behind N reverse proxies", trustProxy: 1 being the canonical single-proxy setting) remain vulnerable. An attacker who can reach the Fastify origin directly, bypassing the front-facing proxy, can spoof the request fields exactly as in the unpatched version. Impact class matches the parent CVE-2026-3635: host injection in generated URLs, HTTPS-enforcement bypass, secure-cookie / CSRF-origin bypass, host-based routing and cache poisoning.

Patches

Patched in fastify 5.12.1. The numeric form of trustProxy is now disabled at runtime and removed from the TypeScript type union.

Workarounds

  • Migrate to an IP / CIDR / custom-function trustProxy value that validates the connecting address. Custom functions must inspect the address argument, not only the hop index.
  • Ensure the Fastify origin is only reachable through the trusted proxy chain (no direct network path).

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm fastify >= 5.8.3, < 5.12.1 5.12.1

Referencias

Puntuación CVSS 6.1/10
Vector CVSS
CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
Debilidad (CWE)
CWE-348
Plataforma
npm
Paquete
fastify
Publicada
02.09.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-3m5p-2c4r-xxw2 - CC BY 4.0

Historial de vulnerabilidades: fastify

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (16) en el archivo
Entradas en total
16
Primera → última
07.2018 09.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Alta 8
  • Media 7
  • Baja 1

Divulgaciones por año

  1. 2018: 1
  2. 2019: 0
  3. 2020: 1
  4. 2021: 0
  5. 2022: 2
  6. 2023: 0
  7. 2024: 0
  8. 2025: 1
  9. 2026: 11
Gravedad:
  1. fastify vulnerable to X-Forwarded-* spoofing under trustProxy hop-count esta entrada
    Media · 6.1 CVE-2026-16732 >= 5.8.3, < 5.12.1 5.12.1
  2. Alta · 7.5 CVE-2025-32442 >= 5.0.0, < 5.3.2, >= 4.29.0, < 4.29.1 5.3.2, 4.29.1
  3. Alta · 7.5 CVE-2022-39288 >= 4.0.0, < 4.8.1 4.8.1

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.