Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Config changes for sessions name and server_name/http_host #136

Closed
wants to merge 3 commits into from

Conversation

arfrank
Copy link

@arfrank arfrank commented Jun 8, 2011

Need to check codebase for other $_SERVER['server_name'] uses. One is in MY_config.php (https://github.com/twilio/OpenVBX/blob/master/OpenVBX/libraries/MY_Config.php#L70) and the other is in builtin email library (https://github.com/twilio/OpenVBX/blob/master/system/libraries/Email.php#L1841)

…alid url, but host_name will likely always be. Not sure if changes also need to be made in other sections, such as MY_config library and CI email library
@Gipetto
Copy link
Contributor

Gipetto commented Jul 13, 2011

Aaron, can you expand on what these changes are in response to?

I think we can fall back to HTTP_HOST if server name is not available. The part that worries me about doing this is that SERVER_NAME is a configuration value set in the Apache config and HTTP_HOST is a value sent by the client. The HTTP_HOST is not reliable because it can be modified by the client at the time of the request (ie: spoofed). This can potentially open up some security issues as we're now using URLs that have possibly been modified by the user.

Edit after further looking I found that the UseCanonicalName directive for Apache can effect this behavior as well. With UseCanonicalName set to off it will examine the HTTP_HOST as supplied by the client and use the ServerName if the HTTP_HOST is not defined. So, SERVER_NAME may already be pulling from HTTP_HOST.

I'm still leaning towards leaving SERVER_NAME and making sure that Apache properly reports back the server's name when it can't pull that from the client request.

@arfrank
Copy link
Author

arfrank commented Jul 24, 2011

It was in response to http_host being more reliable as a url than server_name, but maybe a check to see if server name is properly formed and a fallback would work.

What got this going was working on dotcloud, which uses NGINX not reporting the server name as a url, so it would never actually set the cookie.

@Gipetto
Copy link
Contributor

Gipetto commented Jul 29, 2011

Okay. We'll test this out and see how it looks.

@Gipetto
Copy link
Contributor

Gipetto commented Aug 13, 2011

Some of these changes have been integrated in to the develop branch to better accommodate nginx servers.

See: 9e0b89a

If this stabilizes us then we'll work on the best way to implement some xss protection in to this. Not like we had any before, but no time like the present to fix that, right?

@Gipetto
Copy link
Contributor

Gipetto commented Aug 17, 2011

Closing this as these changes largely got integrated through different means.

@Gipetto Gipetto closed this Aug 17, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants