Skip to content

GHSA-36fc-7wjg-mfvj CVE-2026-45162

Pimcore has Unsafe PHP Deserialization in Multiple Locations Without allowed_classes Restriction

High Packagist
Severity
8.0 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.99%
Chance of exploitation in the next 30 days. Higher than 62.42% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-502 Deserialization of Untrusted Data
Fix
12.3.7
Upgrade pimcore/pimcore to this version or later

Description

GitHub Security Advisory Draft — GM-374

Summary

Multiple locations in Pimcore v11 call PHP's unserialize() on data from database columns and filesystem files without the allowed_classes restriction, enabling object injection if an attacker can control the serialized data source.

Severity

CVSS 3.1: 8.0 (High) — AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H

Affected Component

  • Package: pimcore/pimcore and pimcore/admin-ui-classic-bundle
  • Files:
    • lib/Tool/Authentication.php (line 82) — session token deserialization
    • models/Site/Dao.php (line 68) — site domains from database
    • models/DataObject/ClassDefinition/CustomLayout/Dao.php (line 69) — layout definitions from database
    • models/Tool/TmpStore/Dao.php (line 64) — temporary store data from database
    • models/Asset/WebDAV/Service.php (line 36) — delete log from filesystem
    • admin-ui-classic-bundle/src/Helper/Dashboard.php (line 64) — dashboard config from filesystem

Description

Six locations in Pimcore core call unserialize() directly (bypassing Tool\Serialize) on data sourced from database columns or filesystem files without passing the allowed_classes parameter. This means any class available in the autoloader will be instantiated during deserialization.

If an attacker can write to the data source (e.g., via SQL injection targeting the tmp_store, sites, or custom_layouts tables, or via a file write vulnerability targeting the WebDAV delete log), they can inject serialized PHP gadget chains that execute arbitrary code when the data is deserialized.

This is related to but distinct from the Tool\Serialize::unserialize() issue — these calls bypass the wrapper entirely.

Impact

PHP object injection leading to Remote Code Execution when chained with a data source write vulnerability. Pimcore's dependency tree (Guzzle, Symfony, Monolog, Doctrine) provides numerous known gadget chains.

Proof of Concept

  1. Identify a writable data source (e.g., tmp_store table via SQL injection, or webdav-delete.dat via file write)
  2. Write a serialized PHP gadget chain (e.g., Monolog BufferHandler chain from phpggc)
  3. Trigger the deserialization (e.g., access a page that reads TmpStore, or trigger a WebDAV operation)
  4. The gadget chain executes with web server privileges

Suggested Fix

Add allowed_classes parameter to all unserialize() calls. Where no objects are needed, use ['allowed_classes' => false]. Consider migrating to JSON serialization for data that doesn't require object preservation.

// Example fix for Site/Dao.php:
$siteDomains = unserialize($site['domains'], ['allowed_classes' => false]);

// Example fix for TmpStore/Dao.php:
$item['data'] = unserialize($item['data'], ['allowed_classes' => false]);

References

  • CWE-502: Deserialization of Untrusted Data
  • OWASP Deserialization Cheat Sheet
  • phpggc: PHP Generic Gadget Chains

Affected versions

Packagist

PackageVulnerableFixed in
pimcore/pimcore
>= 12.0.0-RC1, < 12.3.7
12.3.7
pimcore/pimcore
< 11.5.17
11.5.17
pimcore/pimcore
>= 2026.1.0, < 2026.1.3
2026.1.3

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

pimcore/pimcore Packagist → 12.3.7

composer
composer require pimcore/pimcore:^12.3.7

Severity breakdown

CVSS 3.1 8.0

CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Weakness

CWE-502: Deserialization of Untrusted Data

The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.

How to prevent it
  • Architecture and Design, Implementation: If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
  • Implementation: When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
  • Implementation: Explicitly define a final object() to prevent deserialization.
  • Architecture and Design, Implementation: Make fields transient to protect them from deserialization. An attempt to serialize and then deserialize a class containing transient fields will result in NULLs where the transient data should be. This is an excellent way to prevent time, environment-based, or sensitive variables from being carried over and used improperly.
  • Implementation: Avoid having unnecessary types or gadgets (a sequence of instances and method invocations that can self-execute during the deserialization process, often found in libraries) available that can be leveraged for malicious ends. This limits the potential for unintended or unauthorized types and gadgets to be leveraged by the attacker. Add only acceptable classes to an allowlist. Note: new gadgets are constantly being discovered, so this alone is not a sufficient mitigation.
  • Architecture and Design, Implementation: Employ cryptography of the data or code for protection. However, it's important to note that it would still be client-side security. This is risky because if the client is compromised then the security implemented on the client (the cryptography) can be bypassed.
  • Operation: Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-23rh-xw42-fq82
Pimcore: SQL Injection in Custom Reports via Malicious Report Configuration
High Also affects pimcore/pimcore
GHSA-9x44-4gxf-8c25
Pimcore Vulnerable to Remote Code Execution via DataObject Class-Definition Field Name
Critical Also affects pimcore/pimcore
GHSA-w23p-wrp7-ch38
Pimcore Hotspotimage getDataFromResource() unrestricted Serialize::unserialize over object-store column (PHP Object Injection, CWE-502)
Critical Also affects pimcore/pimcore
GHSA-2mhj-fhvg-v428
Pimcore: ClassDefinition UID regex missing end anchor allows SQL injection via Block.php unquoted table name
High Also affects pimcore/pimcore
GHSA-7p36-fq2r-4h7r
Pimcore CMS Twig Sandbox Bypass via SecurityPolicy checkMethodAllowed
High Also affects pimcore/pimcore
GHSA-jwcc-gv4m-93x6
Pimcore has a CustomReports Share Bypass
High Also affects pimcore/pimcore
GHSA-332x-r494-54fq
Pimcore has a WordExport Authorization Bypass for Unauthorized Document Export
Medium Also affects pimcore/pimcore
GHSA-wc7j-g8wx-m2qx
Pimcore: Missing Authorization in WebDAV MOVE via unchecked asset move handling
High Also affects pimcore/pimcore
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor