-
Notifications
You must be signed in to change notification settings - Fork 74
Prevent parameters in POST overriding other values #48
base: master
Are you sure you want to change the base?
Conversation
I spoke to @claudevervoort about this and he +1ed the patch. |
I do not see the issue here. I believe the OAuth code used in this library does not support signed requests which have parameters on the query string and in the post data with the same name. If such a request is received the signature check will fail. The only possible modification which could be made in transit would be for a user to change the location of a parameter from the query string to the post data (or vice versa) but the name and value of the parameter would have to remain the same. Am I missing something? |
Hi Stephen, Thanks for the response. I hope the reproduction steps below help. Prerequisite steps
To carry out the exploit:
OutcomeThe student will now also be enrolled as a non-editing teacher on the publisher site. There are other parameters in the request that you could modify, including 'user_id'. Which could allow you to log in as another lti user on the publisher site. |
OK, thanks for the example, though I am not sure the order of the parameters in the query string should matter as this should not affect the signature. Would this issue not be fixed by just using stristr instead of strstr when checking the value of the Content-Type header? Is there also a potential issue with the case of the name of the Content-Type header or does PHP normalise the header names. I will experiment if no one else has. |
i'm no php expert but my initial reaction was I think the same as yours Stephen, just make the comparison case insensitive. However Mark showed me the other patch and it shrugs on the content type and handle POST params if there are any. That seemed even better to me, why care about content type at all if there are POST params? |
Users can modify parameters when going from a consumer site to a publisher site using LTI. There is some protection against this by signing a request using a secret available to the publisher and consumer sites. However, this is signing can be worked around by modifying the request to the publisher.