-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote Address behind proxies/cdn's #101
base: master
Are you sure you want to change the base?
Conversation
…rds compatibility
For some reason the other commits are also mentioned, although they are already merged, I probably did something wrong, but still, the only file being modified is the external/header |
@@ -51,7 +51,28 @@ public static function __callstatic($name, $arguments) | |||
} | |||
|
|||
// Only users from authorized IP addresses may control Profiling | |||
if ($controlIPs === false || in_array($_SERVER['REMOTE_ADDR'], $controlIPs) || PHP_SAPI == 'cli') | |||
function get_client_ip() { | |||
$ipaddress = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Are all these headers really need to be checked?
- Blindly trusting IP provided in these headers actually open a security hole, where an attacker can put needed IP in a header and force website to run slower due fact, that xhprof is collecting analytics data. And in fact it will print profiling link back to attacker, which in turn would reveal some sensitive info about website itself.
There is also something wrong with commit you've used to create the PR branch, because surely you haven't made 9 commits just to create 1 function. Rebasing and force pushing would help in this case. And I've just tried to rebase and got some conflicts. |
Here is my suggested fix for Issue #100
Please review and check if it suits the project.
Thanks x)