diff --git a/app-modules/integration-twilio/src/Http/Middleware/EnsureTwilioRequestIsValid.php b/app-modules/integration-twilio/src/Http/Middleware/EnsureTwilioRequestIsValid.php index 05786f8bfe..d41986fe22 100644 --- a/app-modules/integration-twilio/src/Http/Middleware/EnsureTwilioRequestIsValid.php +++ b/app-modules/integration-twilio/src/Http/Middleware/EnsureTwilioRequestIsValid.php @@ -39,6 +39,7 @@ use AdvisingApp\IntegrationTwilio\Settings\TwilioSettings; use Closure; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; use Twilio\Security\RequestValidator; class EnsureTwilioRequestIsValid @@ -67,6 +68,12 @@ public function handle($request, Closure $next): mixed } if (! $validator->validate($request->header('X-Twilio-Signature'), $request->fullUrl(), $requestData)) { + Log::warning('Twilio request could not be verified.', [ + 'signature' => $request->header('X-Twilio-Signature'), + 'url' => $request->fullUrl(), + 'data' => $requestData, + ]); + abort(403); } diff --git a/composer.json b/composer.json index daf7705346..02ff031269 100644 --- a/composer.json +++ b/composer.json @@ -106,7 +106,7 @@ "talkroute/message-segment-calculator": "^1.0", "tapp/filament-timezone-field": "^3.0", "tpetry/laravel-postgresql-enhanced": "^2.0", - "twilio/sdk": "^7.15" + "twilio/sdk": "^8.3.15" }, "require-dev": { "barryvdh/laravel-ide-helper": "^3.5", @@ -255,4 +255,4 @@ } } ] -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index fc04b95d3e..f4723df79b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3a8c0b6f63ba0b6f41e36c19ff049698", + "content-hash": "b6423359b2a36f9686ac8e4142c31ca4", "packages": [ { "name": "amphp/amp", @@ -19278,16 +19278,16 @@ }, { "name": "twilio/sdk", - "version": "7.16.2", + "version": "8.3.15", "source": { "type": "git", "url": "https://github.com/twilio/twilio-php.git", - "reference": "02ad214b0cc9fc513bd67df251d54aed8901284f" + "reference": "3113e8a672edf5e012120fa6fafc201e013c7ba4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twilio/twilio-php/zipball/02ad214b0cc9fc513bd67df251d54aed8901284f", - "reference": "02ad214b0cc9fc513bd67df251d54aed8901284f", + "url": "https://api.github.com/repos/twilio/twilio-php/zipball/3113e8a672edf5e012120fa6fafc201e013c7ba4", + "reference": "3113e8a672edf5e012120fa6fafc201e013c7ba4", "shasum": "" }, "require": { @@ -19325,9 +19325,9 @@ ], "support": { "issues": "https://github.com/twilio/twilio-php/issues", - "source": "https://github.com/twilio/twilio-php/tree/7.16.2" + "source": "https://github.com/twilio/twilio-php/tree/8.3.15" }, - "time": "2024-04-01T10:34:42+00:00" + "time": "2025-02-20T14:18:17+00:00" }, { "name": "ueberdosis/tiptap-php",