CVE-2023-3574 (published 2023-07-10T16:15Z)

Improper Authorization in GitHub repository pimcore/customer-data-framework prior to 3.4.1.

CVSS v3 base score: 6.5, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N)

Weakness information:
cwe_id: NVD-CWE-Other
cwe_name: Other
description: NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
extended_description: Insufficient Information

Fix information:
repo_url: https://github.com/pimcore/customer-data-framework
commit_details: repo_url: https://github.com/pimcore/customer-data-framework
author: JiaJia Ji
author_date: 2023-07-04 15:24:07+02:00
msg: [Bug]: Add missing permission check on Rules controller (#483)

* chore: fix rules permission check

* Apply php-cs-fixer changes

* chore: fix wrong class

* Update RulesController.php

* fix stan

---------

Co-authored-by: kingjia90 <kingjia90@users.noreply.github.com>
repository: repo_url: https://github.com/pimcore/customer-data-framework
repo_name: pimcore/customer-data-framework
description: Customer Data Framework community bundle adds capability for management of customer data to Pimcore.
repo_language: PHP
owner: pimcore
file_changes: filename: RulesController.php
change_type: ModificationType.MODIFY
diff: @@ -15,14 +15,22 @@
 
 namespace CustomerManagementFrameworkBundle\Controller\Admin;
 
+use Pimcore\Bundle\AdminBundle\Controller\AdminController;
+use Pimcore\Controller\KernelControllerEventInterface;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\Event\ControllerEvent;
 use Symfony\Component\Routing\Annotation\Route;
 
 /**
  * @Route("/rules")
  */
-class RulesController extends \Pimcore\Bundle\AdminBundle\Controller\AdminController
+class RulesController extends AdminController implements KernelControllerEventInterface
 {
+    public function onKernelControllerEvent(ControllerEvent $event)
+    {
+        $this->checkPermission('plugin_cmf_perm_customer_automation_rules');
+    }
+
     /**
      * get saved action trigger rules
      *

programming_language: PHP
filename: SegmentTracker.php
change_type: ModificationType.MODIFY
diff: @@ -175,17 +175,15 @@ class SegmentTracker
 
         //order segments by count, pick $limitSegmentCountPerGroup top segments
         foreach ($segmentCollection as $group => $groupCollection) {
-            if (!empty($groupCollection)) {
-                usort($groupCollection, function ($left, $right) {
-                    if ($left['count'] === $right['count']) {
-                        return 0;
-                    }
+            usort($groupCollection, function ($left, $right) {
+                if ($left['count'] === $right['count']) {
+                    return 0;
+                }
 
-                    return ($left['count'] < $right['count']) ? 1 : -1;
-                });
+                return ($left['count'] < $right['count']) ? 1 : -1;
+            });
 
-                $segmentCollection[$group] = array_slice($groupCollection, 0, $limitSegmentCountPerGroup);
-            }
+            $segmentCollection[$group] = array_slice($groupCollection, 0, $limitSegmentCountPerGroup);
         }
 
         return $segmentCollection;

programming_language: PHP