/

CVE-2026-42471

Severity:

HIGH RISK

(8.1)

Unsafe Deserialization in MixPHP Framework Sync-Invoke

CVE-2026-42471

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution on Client Systems

Severity:

HIGH RISK

(8.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

MixPHP Framework 2.x through 2.2.17 contains an unsafe deserialization flaw in its sync-invoke client, which unserializes data directly from server responses.

When a client connects to a malicious or compromised server, this can allow remote code execution on the client side during response handling.

Affected context

This vulnerability occurs in applications built with MixPHP Framework 2.x through 2.2.17 that use the sync-invoke client component.

The affected code path is in Connection.php where unserialize() is invoked on data received from the remote server.

The risk is present whenever a client connects to servers that may be malicious, misconfigured, or otherwise not fully trusted, including third-party services, test environments, or compromised internal endpoints.

Exploit preconditions

  • Attack surface: Client application using MixPHP's sync-invoke client to communicate with a remote server.
  • Required access: Ability for an attacker to control or impersonate the server endpoint (e.g., operating a malicious server, DNS hijacking, or compromising a legitimate service).
  • Trigger point: The client processes a response containing attacker-controlled serialized data, which is passed directly into unserialize().
  • Why exploitation is possible: The client trusts the server response as safe and uses PHP's native unserialize() without validation, type restrictions, or a safe data format, enabling gadget-based code execution during deserialization.

Why this happens

The underlying issue is reliance on PHP's unserialize() to process untrusted data coming from a remote server.

This matches CWE-502: Deserialization of Untrusted Data, where serialized input is treated as trusted objects.

PHP object deserialization can invoke magic methods (__wakeup, __destruct, etc.) and leverage existing classes as "gadgets" to perform actions, including executing arbitrary code, writing files, or triggering network calls.

In the sync-invoke client, the design assumes the server is inherently trustworthy, so no checks, type enforcement, or alternative safe encoding (such as JSON) is used before deserializing the response.

Potential impact

  • Execution of arbitrary PHP code on the client host.
  • Theft or exposure of sensitive data held by the client application (tokens, secrets, configuration).
  • File manipulation on the client system (creation, modification, deletion) within the application's permissions.
  • Lateral movement within the client environment by abusing the compromised application's privileges.
  • Service disruption, including crashes or resource exhaustion on the client due to malicious payloads.

General mitigation guidance

Effective mitigation focuses on stopping deserialization of untrusted data and constraining what data is accepted from remote servers:

  • Replace PHP serialize()/unserialize() over the network with safer formats such as JSON, protocol buffers, or other data-only encodings.
  • If legacy interoperability requires serialized data, use hardened alternatives (e.g., format-specific decoders) that avoid generic object deserialization and only reconstruct simple data structures.
  • Introduce explicit schema or type validation on responses, rejecting unexpected structures before any transformation back into complex objects.
  • Reduce the trust boundary by treating all remote responses as untrusted, even from internal or "trusted" servers, and limit what actions deserialized data can trigger.
  • Run the client application with least-privilege OS and runtime permissions to reduce the blast radius if a compromise occurs.

How teams detect issues like this

Identifying and monitoring this class of issue typically involves a combination of code-level and behavioral checks:

  • Static analysis: Flag direct calls to unserialize() (and similar APIs) on data originating from network sockets, HTTP clients, or other I/O sources; require justification or replacement with safe parsing.
  • Code review: Look for patterns where server responses are blindly deserialized, especially in client SDKs, RPC layers, or framework-provided connection utilities.
  • Security testing: During dynamic testing, simulate malicious endpoints returning crafted serialized payloads to validate that clients reject or safely handle unexpected data formats.
  • Policy enforcement: Define internal guidelines discouraging use of PHP serialization for network communication; integrate automated checks in CI/CD pipelines to prevent new instances of unsafe deserialization.

Sources

SourceLink
gist.github.comgist.github.com/sgInnora/fa46386840fe978a30d7e53c458f2975
github.comgithub.com/mix-php/mix
github.comgithub.com/mix-php/mix/blob/v2.2.17/src/sync-invoke/src/Server.php

Frequently asked

questions

Yes. An attacker who can control or impersonate the server endpoint can send crafted serialized payloads that the MixPHP sync-invoke client will unserialize, potentially leading to remote code execution on the client.

The attacker needs the ability to make the client talk to a malicious or compromised server—this can be done by operating a rogue service, compromising DNS or routing, or taking over an existing upstream service that the client already trusts.

The safest pattern is to remove the use of PHP unserialize() for processing server responses and instead use a data-only serialization format (such as JSON) with strict validation. Where deserialization is unavoidable, restrict it to simple types and avoid reconstructing arbitrary objects.

Establish a rule that untrusted data—including all network responses—must never be passed to generic object deserialization APIs. Use safe data formats by default, enforce this in coding standards and code review, and back it up with static analysis that flags unsafe deserialization patterns.

Find out what's already
exploitable in your codebase.