VYPR
High severityNVD Advisory· Published Jul 12, 2022· Updated Apr 23, 2025

Race Condition in October CMS upload process

CVE-2022-24800

Description

October/System is the system module for October CMS, a self-hosted CMS platform based on the Laravel PHP Framework. Prior to versions 1.0.476, 1.1.12, and 2.2.15, when the developer allows the user to specify their own filename in the fromData method, an unauthenticated user can perform remote code execution (RCE) by exploiting a race condition in the temporary storage directory. This vulnerability affects plugins that expose the October\Rain\Database\Attach\File::fromData as a public interface and does not affect vanilla installations of October CMS since this method is not exposed or used by the system internally or externally. The issue has been patched in Build 476 (v1.0.476), v1.1.12, and v2.2.15. Those who are unable to upgrade may apply with patch to their installation manually as a workaround.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
october/systemPackagist
< 1.0.4761.0.476
october/systemPackagist
>= 1.1.0, < 1.1.121.1.12
october/systemPackagist
>= 2.0.0, < 2.2.152.2.15

Affected products

1

Patches

1
fe569f3babf3

Refactor

https://github.com/octobercms/librarySam GeorgesMar 29, 2022via ghsa
1 file changed · +5 4
  • src/Database/Attach/File.php+5 4 modified
    @@ -124,14 +124,14 @@ public function fromPost($uploadedFile)
         /**
          * fromFile creates a file object from a file on the disk
          */
    -    public function fromFile($filePath)
    +    public function fromFile($filePath, $filename = null)
         {
             if ($filePath === null) {
                 return;
             }
     
             $file = new FileObj($filePath);
    -        $this->file_name = $file->getFilename();
    +        $this->file_name = empty($filename) ? $file->getFilename() : $filename;
             $this->file_size = $file->getSize();
             $this->content_type = $file->getMimeType();
             $this->disk_name = $this->getDiskName();
    @@ -152,10 +152,11 @@ public function fromData($data, $filename)
                 return;
             }
     
    -        $tempPath = temp_path(basename($filename));
    +        $tempName = str_replace('.', '', uniqid('', true)) . '.tmp';
    +        $tempPath = temp_path($tempName);
             FileHelper::put($tempPath, $data);
     
    -        $file = $this->fromFile($tempPath);
    +        $file = $this->fromFile($tempPath, basename($filename));
             FileHelper::delete($tempPath);
     
             return $file;
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.