Missing file upload type validation in pimcore/pimcore
Description
Pimcore is an Open Source Data & Experience Management Platform: PIM, MDM, CDP, DAM, DXP/CMS & Digital Commerce. The upload functionality for updating user profile does not properly validate the file content-type, allowing any authenticated user to bypass this security check by adding a valid signature (p.e. GIF89) and sending any invalid content-type. This could allow an authenticated attacker to upload HTML files with JS content that will be executed in the context of the domain. This issue has been patched in version 10.5.16.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
pimcore/pimcorePackagist | < 10.5.16 | 10.5.16 |
Affected products
1Patches
175a448ef8ac7[Task]: Mime type check on Profile Avatar upload (#14125)
3 files changed · +17 −0
bundles/AdminBundle/Controller/Admin/UserController.php+11 −0 modified@@ -21,12 +21,14 @@ use Pimcore\Bundle\AdminBundle\HttpFoundation\JsonResponse; use Pimcore\Controller\KernelControllerEventInterface; use Pimcore\Logger; +use Pimcore\Model\Asset; use Pimcore\Model\DataObject; use Pimcore\Model\Element; use Pimcore\Model\User; use Pimcore\Tool; use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface; use Symfony\Component\HttpFoundation\BinaryFileResponse; +use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; @@ -797,6 +799,15 @@ public function uploadImageAction(Request $request) throw $this->createAccessDeniedHttpException('Only admin users are allowed to modify admin users'); } + //Check if uploaded file is an image + $avatarFile = $request->files->get('Filedata'); + + $assetType = Asset::getTypeFromMimeMapping($avatarFile->getMimeType(), $avatarFile); + + if (!$avatarFile instanceof UploadedFile || $assetType !== 'image') { + throw new \Exception('Unsupported file format.'); + } + $userObj->setImage($_FILES['Filedata']['tmp_name']); // set content-type to text/html, otherwise (when application/json is sent) chrome will complain in
bundles/AdminBundle/Resources/public/js/pimcore/settings/profile/panel.js+3 −0 modified@@ -250,6 +250,9 @@ pimcore.settings.profile.panel = Class.create({ Ext.getCmp("pimcore_profile_delete_image_" + this.currentUser.id).setVisible(true); pimcore.helpers.reloadUserImage(this.currentUser.id); this.currentUser.hasImage = true; + }.bind(this), + function () { + Ext.MessageBox.alert(t('error'), t("unsupported_filetype")); }.bind(this) ); }.bind(this)
bundles/AdminBundle/Resources/public/js/pimcore/settings/user/user/settings.js+3 −0 modified@@ -177,6 +177,9 @@ pimcore.settings.user.user.settings = Class.create({ Ext.getCmp("pimcore_user_delete_image_" + this.currentUser.id).setVisible(true); pimcore.helpers.reloadUserImage(this.currentUser.id); this.currentUser.hasImage = true; + }.bind(this), + function () { + Ext.MessageBox.alert(t('error'), t("unsupported_filetype")); }.bind(this) ); }.bind(this)
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-8xv4-jj4h-qww6ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-23937ghsaADVISORY
- github.com/pimcore/pimcore/commit/75a448ef8ac74424cf4e723afeb6d05f9eed872fghsax_refsource_MISCWEB
- github.com/pimcore/pimcore/pull/14125ghsaWEB
- github.com/pimcore/pimcore/security/advisories/GHSA-8xv4-jj4h-qww6ghsax_refsource_CONFIRMWEB
- huntr.dev/bounties/aa7ee076-d729-4fcc-9bcc-48bcbb8eac38ghsaWEB
News mentions
0No linked articles in our index yet.