CVE-2023-41892 (PHP, published 2023-09-13T20:15Z)
Description: value: Craft CMS is a platform for creating digital experiences. This is a high-impact, low-complexity attack vector. Users running Craft installations before 4.4.15 are encouraged to update to at least that version to mitigate the issue. This issue has been fixed in Craft CMS 4.4.15.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-94 \u2014 Improper Control of Generation of Code ('Code Injection')
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
Repository: https://github.com/craftcms/cms
Files changed:
src/controllers/AssetIndexesController.php
src/controllers/AssetSettingsController.php
src/controllers/BaseElementsController.php
src/controllers/ConditionsController.php
src/controllers/FieldsController.php
src/controllers/FsController.php
src/controllers/GraphqlController.php
src/controllers/ImageTransformsController.php
src/controllers/LivePreviewController.php
src/controllers/PluginStoreController.php
src/controllers/PluginsController.php
src/controllers/RebrandController.php
src/controllers/RoutesController.php
src/controllers/SectionsController.php
src/controllers/SitesController.php
src/controllers/StructuresController.php
src/controllers/SystemMessagesController.php
src/controllers/SystemSettingsController.php
src/controllers/UserSettingsController.php
src/controllers/VolumesController.php
Commit message: Call beforeAction() up front


Vulnerable code:
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        Craft::$app->requireEdition(Craft::Pro);

        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);
        return parent::beforeAction($action);

Fixed code:
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        $this->requireCpRequest();

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        Craft::$app->requireEdition(Craft::Pro);

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }


        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;
        if (!parent::beforeAction($action)) {
            return false;
        }

        return true;