High severity7.5NVD Advisory· Published Feb 5, 2025· Updated Apr 15, 2026
CVE-2025-1025
CVE-2025-1025
Description
Versions of the package cockpit-hq/cockpit before 2.4.1 are vulnerable to Arbitrary File Upload where an attacker can use different extension to bypass the upload filter.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
cockpit-hq/cockpitPackagist | < 2.4.1 | 2.4.1 |
Patches
3af86ab1d0f48984ef9ad2703add additional security check for uploading files
2 files changed · +2 −2
modules/Assets/bootstrap.php+1 −1 modified@@ -81,7 +81,7 @@ $_sizeAllowed = $max_size ? filesize($files['tmp_name'][$i]) < $max_size : true; // prevent uploading php files - if ($_isAllowed && pathinfo($_file, PATHINFO_EXTENSION) === 'php') { + if ($_isAllowed && in_array(strtolower(pathinfo($_file, PATHINFO_EXTENSION)), ['php', 'phar', 'phtml'])) { $_isAllowed = false; }
modules/Finder/Controller/Finder.php+1 −1 modified@@ -427,7 +427,7 @@ protected function _isFileTypeAllowed($file) { $allowed = trim($this->app->retrieve('finder.allowed_uploads', '*')); - if (strtolower(pathinfo($file, PATHINFO_EXTENSION)) == 'php' && !$this->helper('acl')->isSuperAdmin()) { + if (in_array(strtolower(pathinfo($file, PATHINFO_EXTENSION)), ['php', 'phar', 'phtml']) && !$this->helper('acl')->isSuperAdmin()) { return false; }
becca806c707Prevent uploading php files in assets manager
2 files changed · +9 −0
CHANGELOG.md+4 −0 modified@@ -1,5 +1,9 @@ # Release Notes +## WIP + +- Prevent uploading php files in assets manager + ## 2.4.0 (2023-03-08) - Add additional security check editing php files in finder
modules/Assets/bootstrap.php+5 −0 modified@@ -80,6 +80,11 @@ $_isAllowed = $allowed === true ? true : preg_match("/\.({$allowed})$/i", $_file); $_sizeAllowed = $max_size ? filesize($files['tmp_name'][$i]) < $max_size : true; + // prevent uploading php files + if ($_isAllowed && pathinfo($_file, PATHINFO_EXTENSION) === 'php') { + $_isAllowed = false; + } + if (!$files['error'][$i] && $_isAllowed && $_sizeAllowed && move_uploaded_file($files['tmp_name'][$i], $_file)) { $_files[] = $_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
6- github.com/advisories/GHSA-wp68-xrfg-xvq4ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-1025ghsaADVISORY
- gist.github.com/CHOOCS/fe1227443544d5d74c33982814f290afnvdWEB
- github.com/Cockpit-HQ/Cockpit/commit/984ef9ad270357b843af63c81db95178eae42caenvdWEB
- github.com/Cockpit-HQ/Cockpit/commit/becca806c7071ecc732521bb5ad0bb9c64299592nvdWEB
- security.snyk.io/vuln/SNYK-PHP-COCKPITHQCOCKPIT-8516320nvdWEB
News mentions
0No linked articles in our index yet.