Skip to content

Commit 178eb7b

Browse files
Merge pull request #295 from matomo-org/resolve-aikido-12726180
Code to resolved Aikido reported issue: 12726180
2 parents 6424fe9 + c200716 commit 178eb7b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
5.1.3 - 2025-09-01
44
- Add support for Sentinel password
5+
- Security hardening
56

67
5.1.2 - 2025-07-07
78
- Textual changes

Queue/Backend/MySQL.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function appendValuesToList($key, $values)
9999
{
100100
$table = $this->makePrefixedKeyListTableName($key);
101101

102-
$query = sprintf('INSERT INTO %s (`list_value`) VALUES (?)', $table);
102+
$query = sprintf('INSERT INTO `%s` (`list_value`) VALUES (?)', $table);
103103
foreach ($values as $value) {
104104
if (empty($value)) {
105105
continue;
@@ -143,7 +143,7 @@ public function getFirstXValuesFromList($key, $numValues)
143143
}
144144

145145
$table = $this->makePrefixedKeyListTableName($key);
146-
$sql = sprintf('SELECT SQL_NO_CACHE list_value FROM %s ORDER BY idqueuelist ASC LIMIT %d OFFSET 0', $table, (int)$numValues);
146+
$sql = sprintf('SELECT SQL_NO_CACHE list_value FROM `%s` ORDER BY idqueuelist ASC LIMIT %d OFFSET 0', $table, (int)$numValues);
147147

148148
try {
149149
$values = Db::fetchAll($sql);
@@ -172,7 +172,7 @@ public function hasAtLeastXRequestsQueued($key, $numValuesRequired)
172172
}
173173

174174
$table = $this->makePrefixedKeyListTableName($key);
175-
$sql = sprintf('SELECT SQL_NO_CACHE idqueuelist FROM %s LIMIT %d', $table, (int)$numValuesRequired);
175+
$sql = sprintf('SELECT SQL_NO_CACHE idqueuelist FROM `%s` LIMIT %d', $table, (int)$numValuesRequired);
176176

177177
try {
178178
$values = Db::fetchAll($sql);
@@ -194,7 +194,7 @@ public function removeFirstXValuesFromList($key, $numValues)
194194
}
195195

196196
$table = $this->makePrefixedKeyListTableName($key);
197-
$sql = sprintf('DELETE FROM %s ORDER BY idqueuelist ASC LIMIT %d', $table, (int)$numValues);
197+
$sql = sprintf('DELETE FROM `%s` ORDER BY idqueuelist ASC LIMIT %d', $table, (int)$numValues);
198198

199199
try {
200200
Db::query($sql);
@@ -210,7 +210,7 @@ public function removeFirstXValuesFromList($key, $numValues)
210210
public function getNumValuesInList($key)
211211
{
212212
$table = $this->makePrefixedKeyListTableName($key);
213-
$sql = sprintf('SELECT SQL_NO_CACHE max(idqueuelist) - min(idqueuelist) as num_entries FROM %s', $table);
213+
$sql = sprintf('SELECT SQL_NO_CACHE max(idqueuelist) - min(idqueuelist) as num_entries FROM `%s`', $table);
214214
try {
215215
$value = Db::fetchOne($sql);
216216
if ($value === null || $value === false) {

0 commit comments

Comments
 (0)