/

CVE-2026-45162

Severity:

HIGH RISK

(8.0)

PHP Object Injection (CWE-502) in Pimcore Storage

CVE-2026-45162

Deferred

Vulnerability type

Category:

Unsafe Deserialization / PHP Object Injection

CWE:

CWE-502

Impact:

Remote Code Execution via unsafe PHP deserialization

Severity:

HIGH RISK

(8.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Pimcore uses PHP's unserialize() on data from databases and filesystem files without restricting allowed classes, enabling unsafe object instantiation.

If an attacker can control these serialized data sources, they can inject malicious objects that may lead to remote code execution under affected Pimcore workflows.

Affected context

The vulnerability occurs in Pimcore components that deserialize data retrieved from persistent storage (database columns and filesystem-backed files) using PHP's unserialize() without an allowed_classes restriction.

It is relevant when application features such as authentication helpers, site configuration, custom layout handling, temporary storage, WebDAV asset services, or dashboard helpers read serialized payloads that can be influenced by users or integrated systems.

The risk is elevated in deployments where serialized fields or files are writable by untrusted tenants, external integrations, or compromised application code paths.

Exploit preconditions

  • Attack surface: Pimcore features that load and unserialize data from the database or filesystem (e.g., authentication, site DAO, custom layouts, tmp store, WebDAV service, dashboard).
  • Required access: Ability to inject or modify serialized data stored in targeted columns or files (through application inputs, API endpoints, import mechanisms, or indirect write access).
  • Trigger point: Execution of unserialize() on attacker-controlled data during normal Pimcore operations such as login flows, dashboard loading, site or layout retrieval, asset access, or temporary store usage.
  • Why exploitation is possible: Unserialize() is invoked without allowed_classes restrictions or validation, permitting construction of arbitrary PHP objects and execution of attacker-controlled magic methods or gadget chains.

Why this happens

The core issue is an unsafe deserialization pattern in which PHP's unserialize() is applied to data whose integrity and provenance are not strictly guaranteed.

Because allowed_classes is not used, the deserializer trusts the serialized structure and permits creation of arbitrary application or library objects.

This maps to CWE-502: Deserialization of Untrusted Data, where complex serialized inputs are treated as configuration or state rather than potential executable behavior, creating object injection opportunities and enabling gadget chains that execute code or perform sensitive actions during object lifecycle hooks.

Potential impact

  • Remote code execution in the Pimcore application context
  • Arbitrary method invocation via gadget chains in Pimcore or its dependencies
  • Unauthorized access to or modification of stored data and configuration
  • Escalation of privileges within the Pimcore instance or underlying hosting environment
  • Abuse of file system operations, including reading, writing, or deleting application files
  • Compromise of multi-tenant installations or integrated downstream systems

General mitigation guidance

Effective mitigation typically focuses on reducing trust in serialized data and constraining deserialization behavior.

Recommended patterns include:

  • Avoiding PHP unserialize() for data that can be influenced by users or external systems and migrating to safer, schema-driven formats (e.g., JSON) where possible.
  • Using allowed_classes and disallowing arbitrary classes when deserialization is unavoidable, restricting the object types that can be instantiated.
  • Applying strict validation, integrity checks, and normalization to data before it is deserialized, and rejecting inputs that do not conform to expected structures.
  • Minimizing reliance on serialization for long-lived storage of complex objects; instead store minimal, non-executable state and reconstruct objects from trusted configuration.
  • Running Pimcore with least-privilege service accounts and hardened PHP configuration to reduce the blast radius if deserialization issues are exploited.

How teams detect issues like this

Organizations can detect unsafe PHP deserialization patterns through several complementary approaches:

  • Static analysis rules that flag calls to unserialize() and similar APIs, especially when passed data from databases, files, or user-controlled inputs without allowed_classes restrictions.
  • Targeted code reviews focusing on data access objects, temporary stores, authentication helpers, and integrations that read serialized content, verifying that deserialization is constrained and validated.
  • Security-focused unit and integration tests that simulate attacker-controlled serialized payloads and exercise deserialization paths to detect unexpected object instantiation or side effects.
  • Policy enforcement in CI/CD pipelines that disallow new uses of generic unserialize() or require explicit justification and defensive controls when deserialization is necessary.
  • Periodic runtime monitoring for anomalous PHP object activity, unexpected file or network operations, or error patterns associated with malformed serialized data.

Sources

SourceLink
github.comgithub.com/pimcore/pimcore/commit/4788bf3a3a7f2f760a8fe61e522565941e154e1e
github.comgithub.com/pimcore/pimcore/pull/19119
github.comgithub.com/pimcore/pimcore/releases/tag/v12.3.7
github.comgithub.com/pimcore/pimcore/security/advisories/GHSA-36fc-7wjg-mfvj

Frequently asked

questions

Exploitability depends on whether an attacker can influence the serialized data sources used by the affected components. In environments where attackers can write or tamper with serialized fields or files, the vulnerability can be broadly exploitable and may lead to remote code execution.

An attacker generally needs the ability to inject or modify serialized content that Pimcore later reads and passes to unserialize(), which may be achievable through authenticated application features, compromised integrations, misconfigured import mechanisms, or other indirect write paths to the database or filesystem.

The safest pattern is to eliminate unsafe deserialization entirely for untrusted or semi-trusted data by replacing unserialize() with non-executable data formats and schema-based parsing. Where deserialization must remain, strictly limit allowed classes, validate structure, and ensure that deserialized data originates from trusted, integrity-protected sources.

Prevention requires establishing guidelines that treat serialization as a security-sensitive feature, banning or tightly controlling unserialize() in coding standards, using static analysis and code review to flag new deserialization uses, favoring simple structured formats like JSON, and designing storage schemas that do not rely on persisting complex objects from the runtime.

Find out what's already
exploitable in your codebase.