-
Notifications
You must be signed in to change notification settings - Fork 526
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
Twilio SDK Not Validating Signature #1068
Comments
Can you please mention the version where you found this bug? With the latest release, we have been introduced a fix for twilio signature validation. https://github.com/twilio/twilio-node/releases/tag/5.4.3 |
I'm on 5.4.2 so I suppose a bump is required in order to catch your fix. |
@manisha1997 it looks like that wasn't it. Same code as above now running 5.4.3 and it still comes back as invalid. |
Hi @dcaponi, are you using a URL without a path as a callback? For example, something like The validate function relies on Adding a path or an ending slash to your URL callback should fix your issue. |
Hey @leon19
No, the callback URL I entered into the Messaging Configuration section for my number is
I did try that to no avail though. The URL with the / isn't even being hit on my app side. I did try just setting the url to whatever I have configured in the Twilio dashboard as well (without trailing slash or query params)
|
So anyway if I had to guess, one or more of the following must be happening -
Im fairly certain if there's any guidance in addition to the existing security doc that's focused on SMS validation (this one seems to be focused on call validation and the advice given isn't helping) that outlines the params (in order) required for signature validation that would pretty much get me over the hump and I can stop worrying about hackers pinging the crap out of my webhook and I have no way of knowing if its coming from Twilio 🙂 |
Hi - Please see details below
The Setup
I'm catching requests from Twilio on a SvelteKit API endpoint. I get the request and all the goodies off of it just fine with the following code
The Problem
I've logged out every variable and everything looks correct, and according to all the documentation I could find this seems to be the correct way to validate a signature. I know I have the correct auth credential exported to my environment as I can send texts no problem. The signature is definitely there and all I got from the docs was to send back the
url.toString()
andparams
like so.According to the security docs Im supposed to be sending back like so
however my requests dont have digits or callers (Is there a messaging centric doc I should be looking at 🤔)? I also noticed a Very subtle callout that these need to be alphabetized?
What I tried
If there's a fix or if this is a known issue I'd really appreciate it.
The text was updated successfully, but these errors were encountered: