-
Notifications
You must be signed in to change notification settings - Fork 346
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
GET parameters are parsed incorrectly when base64 string is passed through GET #2105
Comments
You need to urlencode() your URL parameters, a + is not allowed in a URL as it is the placeholder for a space. |
Params are coming urlencoded |
If that is the cause, then a + is correctly translated into a space. If not, please provide an example of a URL. |
I have to hide some parts because there is sensitive data, bet the problem part is unchanged, it's the "VK_MAC" param |
That decodes to
which look fine to me? |
somehow i get "Hjr3N/uwt27m9Sy0ncdECEu/yJycWoZXEH/X4vdkz s9jaG1cvK56SgEZ B1EqJ2bShX4v/kG YG4UgJWOAqMKTukvmeMLouV1CQ0GParFguu81THO7YVhe0PZxEKVxmPdI6pVm35c/99d8acDipznrruZOAH8d7S7ta00G5jNU=" instead |
That smells like double decoding. I'll see if I can find the time to create a small debug app tomorrow. |
i bet it happens here:
You can see $_GET overwriting commented out |
Contents of $_GET is always url decoded, so that's fine. Do you you manually decode again in your app? |
no, i event put debug directly in this segment to check |
I can reproduce it, how about:
let me know if this fixes it for you? |
I am having this problem as well it would seem, here is an example parameter:
It seems to be properly URL Encoded when I receive it, however, Input::get('Auth') returns:
So it seems to be double URL decoding somehow. I have tried your last suggestion on November 27th, but that did not fix the issue. Ultimately since I know this is a BASE64 encoded parameter, I am using:
But that won't work in any other case. |
@nickhagen can you try this? It handles both your example and the one above without issues here. |
p.s. (and that is to all), it might be a better idea to do that the DEBUG log entry at the beginning of that code bit says, and fix your rewrite rule, as that code is only executed if your rewriting is wrong. |
Well ... the plus signs are definitely correctly interpreted now, however, the equal sign at the end is still url encoded:
I tried updating my htaccess file in my public directory to change the rewrite rules as suggested but that didn't seem to change anything.
|
Great. Not. The problem is that in the QUERY_STRING, the first "=" is also URL encoded. I don't know if this is a bug in PHP or something that has changed, but it didn't used to be the case. Back to the drawing board... As to the rewrite rule, if yu use the default htaccess, you have to make sure you change the correct rewrite for your PHP version and type. |
Attempt two. I used this URL for testing:
resulting in thse URI segments:
and these arguments:
|
BAM! That seems to fix it, are there any potential problems that I should look out for with removing that processing line? |
It shouldn't. I went through the commit history, appearently the decoding/encoding was added to address some nginx quirk. But the examples given are handled buy this code as well. I'm closing this issue, let me know if you still find issues. |
Latest core update disabled some my one process. While investigating the issue I've discovered that $_GET is being overwritten in Input_Instance class, uri(). When param contains + or may be some other special characters parse_str performs incorrect by replacing + with space. For now i've disabled GET overwriting but guess this needs to be fixed.
The text was updated successfully, but these errors were encountered: