Skip to content

Commit 96c60d7

Browse files
authored
Merge commit from fork
Fix a SQL injection vulnerability
2 parents 97c9c48 + 83c5ad9 commit 96c60d7

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Fixed a bug where all plugin settings were being saved to the project config, rather than just posted settings. ([craftcms/commerce#4006](https://github.com/craftcms/commerce/issues/4006))
77
- Fixed a bug where custom selects could be positioned incorrectly after the window was resized. ([#18179](https://github.com/craftcms/cms/issues/18179))
88
- Fixed an SSRF vulnerability. (GHSA-96pq-hxpw-rgh8)
9+
- Fixed a SQL injection vulnerability. (GHSA-2453-mppf-46cj)
910

1011
## 4.16.17 - 2025-12-0421
1112

src/controllers/ElementIndexesController.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,23 @@ protected function elementQuery(): ElementQueryInterface
603603
$criteria['draftOf'] = filter_var($criteria['draftOf'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
604604
}
605605
}
606+
607+
// Remove unsupported criteria attributes
608+
unset(
609+
$criteria['where'],
610+
$criteria['orderBy'],
611+
$criteria['indexBy'],
612+
$criteria['select'],
613+
$criteria['selectOption'],
614+
$criteria['from'],
615+
$criteria['groupBy'],
616+
$criteria['join'],
617+
$criteria['having'],
618+
$criteria['union'],
619+
$criteria['withQueries'],
620+
$criteria['params'],
621+
);
622+
606623
Craft::configure($query, Component::cleanseConfig($criteria));
607624
}
608625

0 commit comments

Comments
 (0)