همهٔ گزارش‌ها
زیاد

OroPlatform vulnerable to path traversal during temporary file manipulations

متن اصلی

نسخه‌های متأثر

نسخه‌های متأثر
>= 4.1.0, <= 4.1.13
نسخهٔ اصلاح‌شده
اعلام نشده
نسخه‌های متأثر
>= 5.0.0, < 5.0.8
نسخهٔ اصلاح‌شده
5.0.8
نسخه‌های متأثر
>= 4.2.0, <= 4.2.10
نسخهٔ اصلاح‌شده
اعلام نشده

بهره‌برداری

CVE-2022-41951

احتمال بهره‌برداری در ۳۰ روز آینده: 0.95%

FIRST EPSS · ۱۴۰۵/۰۸/۲۷

شرح آسیب‌پذیری

Impact

Path Traversal is possible in Oro\Bundle\GaufretteBundle\FileManager::getTemporaryFileName. With this method, an attacker can pass the path to a non-existent file, which will allow writing the content to a new file that will be available during script execution. The file will be deleted immediately after the script ends.

Workarounds

Apply patch

--- a/vendor/oro/platform/src/Oro/Bundle/GaufretteBundle/FileManager.php
+++ b/vendor/oro/platform/src/Oro/Bundle/GaufretteBundle/FileManager.php
@@ -614,6 +614,10 @@
      */
     public function getTemporaryFileName(string $suggestedFileName = null): string
     {
+        if ($suggestedFileName) {
+            $suggestedFileName = basename($suggestedFileName);
+        }
+
         $tmpDir = ini_get('upload_tmp_dir');
         if (!$tmpDir || !is_dir($tmpDir) || !is_writable($tmpDir)) {
             $tmpDir = sys_get_temp_dir();

Or decorate Oro\Bundle\GaufretteBundle\FileManager::getTemporaryFileName in your customization and clear $suggestedFileName argument

    public function getTemporaryFileName(string $suggestedFileName = null): string
    {
        if ($suggestedFileName) {
            $suggestedFileName = basename($suggestedFileName);
        }

        return parent::getTemporaryFileName($suggestedFileName);
    }
References

پیوندها