Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Remote Address behind proxies/cdn's #101

wants to merge 9 commits into from

Conversation

tperalta82
Copy link

Here is my suggested fix for Issue #100
Please review and check if it suits the project.

Thanks x)

@tperalta82
Copy link
Author

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 = '';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Are all these headers really need to be checked?
  2. 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.

@aik099
Copy link
Collaborator

aik099 commented Oct 18, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants