Skip to content

Commit ee9775c

Browse files
carlbennettclaude
andcommitted
Fix SQL injection in Packet Index controller
Cast pktapplayer values to int via array_map before interpolating into the SQL IN() clause, preventing injection from user-supplied GET params. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 42c5285 commit ee9775c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Controllers/Packet/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function invoke(?array $args): bool
4242
}
4343

4444
$this->model->packets = \BNETDocs\Libraries\Packet\Packet::getAllPackets(
45-
'`packet_application_layer_id` IN (' . implode( ',', $this->model->pktapplayer ) . ')',
45+
'`packet_application_layer_id` IN (' . implode(',', array_map('intval', $this->model->pktapplayer)) . ')',
4646
$this->model->order
4747
);
4848

0 commit comments

Comments
 (0)