-
Notifications
You must be signed in to change notification settings - Fork 37
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
store.py match("^(.+)=(.+)$", key) lookup breaks entityID's with base64 encoded, padded content #109
Comments
Can you provide a sample URL that breaks? |
Also feel free to provide a PR for quicker review but that URL would make a good testcase... |
Sample entityID URL (obfuscated the domain)
I don't want to create a pullrequest because I'm far from certain that my (quick) fix doesn't break any other intended behaviour. I'd rather you scrutinize the problem and rethink the "=" case to lookup { } logic. In my case the "... adding %s=%s" debug code resulted in an empty v, which is a telltale sign that something went wrong with the earlier rewrite of the "=" case. |
yeah this smells URL encoding fail to me somewhere - normally that == would/should have been URL-encoded before passing to pyFF because otherwize you could never do query-string parsing |
Yes, normaly it's URL encoded, but I think (have to check) that this will be decoded inside the server, so still be a problem? |
Here's proof:
Original request was URL encoded, but lookup debugs the decoded entityID. |
Yeah you're right. I need to think about the right way to deal with this. Your patch at least solves one part of this so I don't mind applying it but this actually needs thought... |
From time to time we're trying to see if running unmodified vanilla pyff would be a viable option, but bugs like this not being patched upstream make it hard. Any progress on the "thoughts" about this? Do you want a PR for the suggested insertion of the four characters? |
Is it still there in the wsgi api?
Skickat från min iPhone
… 26 aug. 2019 kl. 14:38 skrev Martin ***@***.***>:
From time to time we're trying to see if running unmodified vanilla pyff would be a viable option, but bugs like this not being patched upstream make it hard. Any progress on the "thoughts" about this? Do you want a PR for the suggested insertion of the four characters?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
if it is still in HEAD I'd appreciate a PR! |
ping @mrvanes what should we do about this? |
Will that happen often? I doubt it. |
In store.py @270 there is logic to recognise "=" separated keys. We have entityID's that embed base64 encoded information in entityID, one of them ending in the base64 padding "==". This causes _lookup to miss the entityID, causing the discovery page to break with a 404 in mdx.py @588 for this SP.
The following regex solves the problem, but I'm unsure if it would break the intended "=" situation:
And I'm also unsure if it solves the single padded base64 encoded strings, let alone entityID's where the padding is in the middle of the entityID. That would certainly break anytime.
The text was updated successfully, but these errors were encountered: