Skip to content
Finic
Fraud and risk

What is X-Forwarded-For spoofing?

X-Forwarded-For spoofing is when a client sends a fake X-Forwarded-For header to hide its real IP address or to get past IP-based rate limits and location rules.

Also called: XFF spoofing

How it works

When a request passes through a proxy or load balancer, the proxy can add the X-Forwarded-For header with the IP address it saw. This lets the application know the original client address. The problem is that any client can also send this header with any value it likes.

If the application reads the first address in the header, or trusts the header from any source, an attacker can set it to a fake IP. Each request can claim a new address, or an address in a country that the service allows.

Why it matters for fraud and trust

Many controls depend on the client IP: rate limiting, login lockouts, geo rules and IP intelligence checks. If the IP comes from a header the attacker controls, these controls break. A bot that runs credential stuffing can look like thousands of different users, and a blocked region can look like an allowed one.

Warning signs

  • The same connection or device sends many requests, each with a different forwarded IP.
  • Forwarded addresses that are private, reserved or badly formed.
  • A long chain of addresses on traffic that should come straight from your own edge.
  • A forwarded IP in one country and a connection IP, time zone or device data that point to another.

How teams defend against it

Trust only the header values that your own proxies set. Configure the edge to remove or overwrite any X-Forwarded-For that comes from the client, and read the address added by the last proxy that you control. Most web frameworks have a setting for the number of trusted proxy hops.

Do not use IP as the only signal. Device and network data are much harder to fake in a header and give a second view of who is really connecting.

← All glossary terms

Ship fraud, bot and KYB checks in minutes.

Start with $5 of free credit, or copy a prompt and let your coding agent set Finic up.

Sign up See pricing