From ef721fc430fbb19da13060105577bf7605606b81 Mon Sep 17 00:00:00 2001 From: Felix Eckhofer Date: Wed, 26 Mar 2014 14:13:40 +0100 Subject: Add config variable 'proxy_whitelist' HTTP headers X_FORWARDED_* and X_REAL_IP are only evaluated when received from an IP listed in proxy_whitelist. Furthermore, only the last non-trusted IP from X-Forwarded-For is used in place of the real ip. Without this, an attacker can easily spoof the headers and control the result of the ip or ssl check. This fixes several problems with [3a4c9f42], [4d480b36] and [a520f331] as mentioned in #1489729. --- config/defaults.inc.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config') diff --git a/config/defaults.inc.php b/config/defaults.inc.php index e9cc939cb..ffce8e76a 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -358,6 +358,10 @@ $config['memcache_hosts'] = null; // e.g. array( 'localhost:11211', '192.168.1.1 // check client IP in session authorization $config['ip_check'] = false; +// List of trusted proxies +// X_FORWARDED_* and X_REAL_IP headers are only accepted from these IPs +$config['proxy_whitelist'] = array(); + // check referer of incoming requests $config['referer_check'] = false; -- cgit v1.2.3