|
3 | 3 | * Plugin Name: ElementTest Pro |
4 | 4 | * Plugin URI: https://github.com/DougState/elementtest-pro |
5 | 5 | * Description: A/B test various elements (CSS, copy, JS, images) of your pages and track conversion data to measure performance. |
6 | | - * Version: 2.5.15 |
| 6 | + * Version: 2.5.16 |
7 | 7 | * Requires at least: 5.6 |
8 | 8 | * Tested up to: 7.0 |
9 | 9 | * Requires PHP: 7.4 |
|
23 | 23 | } |
24 | 24 |
|
25 | 25 | // Define plugin constants |
26 | | -define( 'ELEMENTTEST_VERSION', '2.5.15' ); |
| 26 | +define( 'ELEMENTTEST_VERSION', '2.5.16' ); |
27 | 27 | define( 'ELEMENTTEST_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
28 | 28 | define( 'ELEMENTTEST_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
29 | 29 | define( 'ELEMENTTEST_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
@@ -120,7 +120,7 @@ public function resolve_proxy_headers( $headers ) { |
120 | 120 | * Forwarded IP headers are only honored when the direct connection |
121 | 121 | * (REMOTE_ADDR) falls inside one of these ranges, so a request that |
122 | 122 | * bypasses the proxy cannot spoof its IP. Sites whose proxy connects |
123 | | - * from a public IP not covered by the defaults below should add their |
| 123 | + * from a public IP (or any nginx/managed-host setup) should add their |
124 | 124 | * proxy's CIDR via the `elementtest_trusted_proxy_cidrs` filter. |
125 | 125 | * |
126 | 126 | * @since 2.5.4 |
@@ -160,16 +160,13 @@ public function resolve_proxy_cidrs( $cidrs ) { |
160 | 160 | ) ); |
161 | 161 | break; |
162 | 162 | case 'nginx': |
163 | | - // Loopback + RFC1918 private ranges: the same-host or |
164 | | - // internal-network reverse proxy used by most managed hosts. |
165 | | - $cidrs = array_merge( $cidrs, array( |
166 | | - '127.0.0.0/8', |
167 | | - '10.0.0.0/8', |
168 | | - '172.16.0.0/12', |
169 | | - '192.168.0.0/16', |
170 | | - '::1/128', |
171 | | - 'fc00::/7', |
172 | | - ) ); |
| 163 | + // Intentionally ships no default CIDRs. Trusting loopback / |
| 164 | + // RFC1918 by default is unsafe on common php-fpm setups where |
| 165 | + // REMOTE_ADDR is 127.0.0.1 for every request — any client that |
| 166 | + // can reach PHP (or whose connection appears as loopback) could |
| 167 | + // spoof X-Forwarded-For / X-Real-IP. Declare your proxy's real |
| 168 | + // egress CIDR via the elementtest_trusted_proxy_cidrs filter; |
| 169 | + // without it, forwarded headers are ignored (secure default). |
173 | 170 | break; |
174 | 171 | // 'custom' ships no default CIDRs — the admin supplies the |
175 | 172 | // proxy's address range via the elementtest_trusted_proxy_cidrs |
|
0 commit comments