Skip to content

Commit e7049de

Browse files
committed
if correct site ID is missing die
1 parent 4bd19d7 commit e7049de

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

interface/modules/custom_modules/oe-module-faxsms/library/webhook_receiver.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
// Set site from query parameter for multi-site support
1919
$_GET['auth'] = 'portal'; // Enable site selection
20-
$_GET['site'] ??= 'default';
20+
21+
if (empty($_GET['site'])) {
22+
error_log('Fax site ID missing');
23+
die;
24+
}
2125

2226
require_once(__DIR__ . "/../../../../globals.php");
2327

@@ -183,6 +187,11 @@ function downloadAndStoreFaxMedia(
183187
int $patientId = 0
184188
): void {
185189
try {
190+
// Validate mediaUrl to prevent SSRF attacks
191+
if (!isValidSignalWireUrl($mediaUrl)) {
192+
error_log("SignalWire Webhook: Invalid or unauthorized media URL: " . $mediaUrl);
193+
return;
194+
}
186195
// Get SignalWire credentials
187196
$vendor = '_signalwire';
188197
$credentials = QueryUtils::querySingleRow(

0 commit comments

Comments
 (0)