Summary
Symfony's Monolog server:log command listens on all network interfaces and blindly unserializes base64-encoded log frames from any reachable host.
This allows remote attackers to send crafted serialized PHP payloads that can crash the listener and may trigger object-injection gadget chains for code execution in affected environments.
Affected context
This vulnerability affects applications or operational environments that use Symfony's ServerLogCommand (Symfony\Bridge\Monolog\Command\ServerLogCommand) for centralized log streaming.
It is relevant when the listener is started with its default behavior of binding to 0.0.0.0:9911 and left reachable from other hosts, such as in shared networks, staging environments, or exposed containers.
The risk increases when the PHP runtime and loaded libraries contain deserialization gadgets that can be abused during unserialize() calls.
Exploit preconditions
- Attack surface: The TCP endpoint exposed by the
server:loglistener, typically on port 9911 bound to0.0.0.0. - Required access: Network-level access to the host and port where the server log listener is running; no authentication is required.
- Trigger point: Sending a base64-encoded serialized PHP payload as a "log frame" over the listener connection.
- Why exploitation is possible: The listener directly invokes
unserialize(base64_decode($message))on attacker-controlled data without authentication, integrity checks, or anallowed_classesallowlist, enabling object injection via standard PHP deserialization behavior.
Why this happens
The underlying bug is the use of insecure deserialization on untrusted input within a network-exposed logging command.
By design, PHP's unserialize() reconstructs arbitrary object graphs, and in ecosystems with complex class hierarchies, this can trigger magic methods or other behaviors as part of object construction or destruction.
The ServerLogCommand treats incoming log frames as trusted and applies unserialize() without any form of class restriction, data validation, or security boundary, which maps directly to CWE-502: Deserialization of Untrusted Data.
Additionally, the decision to bind the listener by default to 0.0.0.0 instead of a local-only interface expands the exposure beyond its operational boundary, relating to CWE-668: Exposure of Resource to Wrong Sphere.
Potential impact
- Remote crash or denial of service of the Symfony Monolog server log listener.
- Execution of attacker-controlled gadget chains if suitable classes and methods are present in the application or environment.
- Unauthorized actions performed in the context of the PHP process (e.g., file operations, HTTP requests, or other side effects provided by available gadgets).
- Lateral movement or deeper compromise of the hosting environment if the process has privileged access to logs, application secrets, or internal services.
General mitigation guidance
Effective mitigation focuses on eliminating unsafe deserialization paths and tightening the exposure of diagnostic interfaces.
Conceptually safer approaches include:
- Avoiding
unserialize()on data that originates from the network or other untrusted sources; prefer structured formats such as JSON or XML with strict schema validation. - Where deserialization cannot be removed, enforcing
allowed_classesrestrictions and treating incoming data as untrusted, rejecting unknown or unexpected types. - Binding debugging or logging listeners to loopback interfaces by default and gating access behind VPNs, firewalls, or authenticated tunnels.
- Running auxiliary logging services with least privilege so that even if compromised, the impact on the wider system is constrained.
- Documenting and reviewing the use of out-of-band diagnostic commands in production to ensure they are either disabled or tightly controlled.
How teams detect issues like this
Detection strategies center on both code-level patterns and operational telemetry.
Typical approaches include:
- Static analysis rules that flag calls to
unserialize()where the input can originate from a socket, HTTP request, or other external channel, particularly inside logging or debug utilities. - Code review checklists that require justification for deserialization usage and verification of class allowlists, validation, and interface binding choices.
- Configuration and infrastructure-as-code policies that fail builds when services bind sensitive debugging or logging endpoints to
0.0.0.0without access controls. - Runtime monitoring for unusual connections to the log listener port (e.g., 9911), malformed base64 frames, or repeated crashes of the logging command.
- Use of application security testing tools that include deserialization probes against exposed endpoints and auxiliary commands.

