EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Additional check in where checker
Yuriie4a6aea90886
diff --git a/application/Espo/Core/Select/Where/Checker.php b/application/Espo/Core/Select/Where/Checker.phpindex 99fe1a6092..1e9270f0c1 100644--- a/application/Espo/Core/Select/Where/Checker.php+++ b/application/Espo/Core/Select/Where/Checker.php@@ -119,6 +119,10 @@ class Checker$forbidComplexExpressions = $params->forbidComplexExpressions();$checkWherePermission = $params->applyPermissionCheck();+ if ($attribute && str_contains($attribute, '#')) {+ throw new Forbidden("Not allowed character in attribute.");+ }+if ($forbidComplexExpressions) {if (in_array($type, $this->subQueryTypeList)) {throw new Forbidden("Sub-queries are forbidden in where.");diff --git a/application/Espo/Tools/Stream/RecordService.php b/application/Espo/Tools/Stream/RecordService.phpindex 90ac43ce04..960cb26bfc 100644--- a/application/Espo/Tools/Stream/RecordService.php+++ b/application/Espo/Tools/Stream/RecordService.php@@ -463,6 +463,7 @@ class RecordService->create()->from(Attachment::ENTITY_TYPE)->withSearchParams($searchParams)+ ->withComplexExpressionsForbidden()->buildQueryBuilder()->where(Condition::in(