When there is an apostrophe in the body the validation of the webhook fails
Open
Nobody has claimed this yet.
status: help wanted
type: bug
- Dominant language
- Ruby
- Stars
- 1.4k
- Forks
- 472
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 5
Description
Issue Summary
An apostrophe in the body of a text message causes validation of Twilio webhook to fail
Steps to Reproduce
- Send a text message with an apostrophe in it
- try to validate the incoming webhook
Code Snippet
twilio_signature = env["HTTP_X_TWILIO_SIGNATURE"]
url = "#{rack_request.scheme}://" + env["HTTP_HOST"] + env["REQUEST_URI"]
unless validator.validate(url, {}, twilio_signature)
raise "Twilio request validation failed."
end
Technical details:
- twilio-ruby version: 5.40.0 (also fails with 5.37.0)
- ruby version: 2.7.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the validator.validate call shown in the issue and reproduce webhook validation with a message containing an apostrophe. Trace the signature-validation path and verify that the same request validates successfully once the bug is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100