-
Notifications
You must be signed in to change notification settings - Fork 720
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
RequestValidator marks valid signature invalid when having multiple values attached to one parameter #613
Comments
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog (ref: DI-1002). |
Hi there, I have been able to figure out how the parameters should be formatted to produce a valid signature. So given
|
Hi, we have since found another edge case this doesn't work with the fix. When some parameters are the same e.g. |
@hugo-netcraft Good catch. Fixed by #617 |
Issue Summary
In some very specific circumstances, the current signature generation/validation does not match the given valid signature (or Twilio's server's logic for generating a signature), which causes a valid request to be marked as invalid. This may also be an issue in the other language, I have not tested them all.
The circumstance is when using Autopilot, you can produce a request with duplicate keys in the POST parameters. This is done by using the same field to pick up multiple values.
I personally do not know what Twilio's servers actually do to generate the request, so you'll have to look into that yourself. I have already tried brute forcing it to figure out how formats parameters when this happens but I have had no luck in that area.
Steps to Reproduce
numbers
, program the task with the following (replacing the url with your own):{numbers} hi {numbers} hi {numbers}
, making sure to makenumbers
use field typeTwilio.NUMBER
6 hi hi
. The server should logRequest Valid
and sayHello
6 hi 4 hi 1
, the server will log this as an invalid requestCode Snippet
Exception/Log
The output for the invalid request is:
As you can see from the above,
Field_number_Value
is duplicated multiple times for each of the values.Then on the next line you can see when trying to access
Field_number_Value
, it only returns 6 - this is not the actual problem but helps to explain the next part.From my testing, I have found that these lines (found here)
ignore the duplicate keys and only adds the first key in the dictionary. E.g. we have the above, it will only add
Field_number_Value6
tos
.Yet again this is also not the issue as I've tried to add a key for each value and it still produces invalid signature, but it is where the logic is differing from Twilio's servers.
Technical details:
The text was updated successfully, but these errors were encountered: