← PHP / Laravel · Contents

PHP-068 / Intermediate

Using untrusted proxy headers (X-Forwarded-For)

A05:2021 Security Misconfiguration · CWE-348 Use of Less Trusted Source

Why is this a problem?

Attackers can forge IP-based restrictions or audit logs.

How to fix it

php
protected $proxies = ['10.0.0.5'];   // Only the actual load-balancer IP

Further reading