Race Condition in October CMS upload process
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.
| Package | Affected versions | Patched versions |
|---|---|---|
october/systemPackagist | < 1.0.476 | 1.0.476 |
october/systemPackagist | >= 1.1.0, < 1.1.12 | 1.1.12 |
october/systemPackagist | >= 2.0.0, < 2.2.15 | 2.2.15 |
Affected products
1- Range: < 1.0.476
Patches
11 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- github.com/advisories/GHSA-8v7h-cpc2-r8jpghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-24800ghsaADVISORY
- github.com/octobercms/library/commit/fe569f3babf3f593be2b1e0a4ae0283506127a83ghsax_refsource_MISCWEB
- github.com/octobercms/october/security/advisories/GHSA-8v7h-cpc2-r8jpghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.