/

CVE-2026-47168

Severity:

CRITICAL RISK

(9.1)

Unsafe Deserialization (CWE-502) in EspoCRM Background Jobs

CVE-2026-47168

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.1)

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

EspoCRM contains an unsafe PHP object deserialization vulnerability in background MassAction and Export processing. An authenticated administrator who can submit crafted serialized object data may cause attacker-controlled objects to be instantiated and potentially execute arbitrary code on the server.

EspoCRM contains an unsafe PHP object deserialization vulnerability in background MassAction and Export processing. An authenticated administrator who can submit crafted serialized object data may cause attacker-controlled objects to be instantiated and potentially execute arbitrary code on the server.

Affected context

The vulnerability affects EspoCRM deployments where administrator-controlled parameters for background MassAction or Export operations are persisted and later passed to PHP deserialization routines. Risk is present when serialized data is accepted without restricting object classes or enforcing a trusted data format before deferred processing.

The vulnerability affects EspoCRM deployments where administrator-controlled parameters for background MassAction or Export operations are persisted and later passed to PHP deserialization routines. Risk is present when serialized data is accepted without restricting object classes or enforcing a trusted data format before deferred processing.

Exploit preconditions

  • Attack surface: Background MassAction and Export parameter handling
  • Required access: Authenticated administrator-level access or equivalent ability to submit affected parameters
  • Trigger point: Later background-job processing that deserializes stored PHP object data
  • Why exploitation is possible: The deserialization paths permit attacker-controlled object instantiation without an effective allowed-class restriction
  • Attack surface: Background MassAction and Export parameter handling
  • Required access: Authenticated administrator-level access or equivalent ability to submit affected parameters
  • Trigger point: Later background-job processing that deserializes stored PHP object data
  • Why exploitation is possible: The deserialization paths permit attacker-controlled object instantiation without an effective allowed-class restriction

Why this happens

The underlying flaw is the use of unrestricted PHP object deserialization on data that can be influenced by an authenticated administrator. PHP deserialization may invoke class-specific behavior while reconstructing objects, so accepting arbitrary serialized objects can turn data processing into code execution when suitable classes or application behaviors are available. This maps to CWE-502, Unsafe Deserialization.

The underlying flaw is the use of unrestricted PHP object deserialization on data that can be influenced by an authenticated administrator. PHP deserialization may invoke class-specific behavior while reconstructing objects, so accepting arbitrary serialized objects can turn data processing into code execution when suitable classes or application behaviors are available. This maps to CWE-502, Unsafe Deserialization.

Potential impact

  • An attacker may execute arbitrary code with the privileges of the application process.
  • The server could be compromised or used for unauthorized access to application data.
  • Sensitive customer, user, or business information could be exposed.
  • Attackers could alter CRM records, disrupt background processing, or establish persistence.
  • A compromised application process could enable further movement within the hosting environment.
  • An attacker may execute arbitrary code with the privileges of the application process.
  • The server could be compromised or used for unauthorized access to application data.
  • Sensitive customer, user, or business information could be exposed.
  • Attackers could alter CRM records, disrupt background processing, or establish persistence.
  • A compromised application process could enable further movement within the hosting environment.

General mitigation guidance

Mitigation generally focuses on removing unsafe object deserialization from

attacker-influenced workflows.

Common defensive patterns include:

  • Prefer a data-only format such as JSON with explicit schemas over native PHP object serialization.
  • Use safe deserialization modes that allow only narrowly defined classes when object serialization cannot be avoided.
  • Treat persisted job parameters as untrusted input and validate their types, structure, and permitted values before processing.
  • Keep background workers and application processes under least-privilege service accounts.
  • Separate job execution privileges from administrative and operating-system privileges.
  • Avoid invoking magic methods or dynamic class behavior based solely on serialized input.
  • Apply integrity controls and access restrictions to stored job parameters.

Mitigation generally focuses on removing unsafe object deserialization from

attacker-influenced workflows.

Common defensive patterns include:

  • Prefer a data-only format such as JSON with explicit schemas over native PHP object serialization.
  • Use safe deserialization modes that allow only narrowly defined classes when object serialization cannot be avoided.
  • Treat persisted job parameters as untrusted input and validate their types, structure, and permitted values before processing.
  • Keep background workers and application processes under least-privilege service accounts.
  • Separate job execution privileges from administrative and operating-system privileges.
  • Avoid invoking magic methods or dynamic class behavior based solely on serialized input.
  • Apply integrity controls and access restrictions to stored job parameters.

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving PHP unserialization of request data, database values, queue messages, or other externally influenced input.
  • Code-review signals such as unrestricted calls to native deserialization functions and missing allowed-class policies.
  • Data-flow analysis tracing administrator-controlled parameters into deferred job handlers.
  • Runtime monitoring for unexpected class names, serialization markers, child processes, or anomalous commands from background workers.
  • Policy enforcement that requires schema-based, data-only formats for queued and persisted parameters.
  • Automated security review tools configured to flag unsafe deserialization APIs and missing trust-boundary validation.

Organizations can look for:

  • Static-analysis findings involving PHP unserialization of request data, database values, queue messages, or other externally influenced input.
  • Code-review signals such as unrestricted calls to native deserialization functions and missing allowed-class policies.
  • Data-flow analysis tracing administrator-controlled parameters into deferred job handlers.
  • Runtime monitoring for unexpected class names, serialization markers, child processes, or anomalous commands from background workers.
  • Policy enforcement that requires schema-based, data-only formats for queued and persisted parameters.
  • Automated security review tools configured to flag unsafe deserialization APIs and missing trust-boundary validation.

Sources

SourceLink
github.comgithub.com/espocrm/espocrm/commit/f48d1d26ffa05eac07ef72bb7f00f67a851184e1
github.comgithub.com/espocrm/espocrm/releases/tag/9.3.7
github.comgithub.com/espocrm/espocrm/security/advisories/GHSA-7q78-jjr9-mqcg

Frequently asked

questions

It may be exploitable through the EspoCRM application interface by an

authenticated administrator, provided the account can create or influence

affected MassAction or Export parameters.

The described attack path requires authenticated administrative access or

another mechanism that grants equivalent control over the relevant parameters.

An unauthenticated attacker cannot normally reach the vulnerable workflow

directly.

Replace native object deserialization with schema-validated, data-only

parsing. If object deserialization is unavoidable, enforce a strict

allowlist of expected classes and reject all other serialized types.

Treat queued and persisted parameters as untrusted, validate them at both

submission and execution time, use least-privilege workers, and include

deserialization checks in static analysis and code-review policies.

It may be exploitable through the EspoCRM application interface by an

authenticated administrator, provided the account can create or influence

affected MassAction or Export parameters.

The described attack path requires authenticated administrative access or

another mechanism that grants equivalent control over the relevant parameters.

An unauthenticated attacker cannot normally reach the vulnerable workflow

directly.

Replace native object deserialization with schema-validated, data-only

parsing. If object deserialization is unavoidable, enforce a strict

allowlist of expected classes and reject all other serialized types.

Treat queued and persisted parameters as untrusted, validate them at both

submission and execution time, use least-privilege workers, and include

deserialization checks in static analysis and code-review policies.

Find out what's already
exploitable in your codebase.