Welcome Guest, Not a member yet? Register   Sign In
_clean_input_keys() does not follow RFC2109
#3

[eluser]BlueCamel[/eluser]
Without downloading it, yes.

The function in SVN Input.php hasn't changed from the 1.6.2 release I'm using. It's stlll called on each key/value pair in the cookie which means it will get tripped by the Mathmatica UA. If you want to see this at the protocol level I have a tcpdump that can be viewed with wireshark showing he issue.

Here is the function that causes the problem when run against each key/value cookie. Adding \$ to the regex obviously resolves the problem by there may be a better way. We know from section 4.3.4 of RFC2109 that only specific special cookies will be passed to us: $Version, $Path, and $Domain. I would propose that we strip off the special "$Key=" part of $str before passing it to this function.

Thoughts?

/**
* Clean Keys
*
* This is a helper function. To prevent malicious users
* from trying to exploit keys we make sure that keys are
* only named with alpha-numeric text and a few other items.
*
* @access private
* @param string
* @return string
*/
function _clean_input_keys($str)
{
if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
{
exit('Disallowed Key Characters.');
}

return $str;
}


Messages In This Thread
_clean_input_keys() does not follow RFC2109 - by El Forum - 10-16-2008, 09:44 PM
_clean_input_keys() does not follow RFC2109 - by El Forum - 10-17-2008, 05:37 AM
_clean_input_keys() does not follow RFC2109 - by El Forum - 10-17-2008, 06:28 AM
_clean_input_keys() does not follow RFC2109 - by El Forum - 10-17-2008, 06:33 AM
_clean_input_keys() does not follow RFC2109 - by El Forum - 10-17-2008, 06:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB