Summary
A PHP object injection vulnerability in the coreActivity: Activity Logging for WordPress plugin allows untrusted data from the User-Agent header to be stored and later deserialized without validation.
Unauthenticated attackers can inject crafted serialized payloads that, when processed by the admin Logs page, trigger a fatal TypeError and create a persistent denial of service for log viewing and analysis.
Affected context
The vulnerability exists in WordPress sites using the coreActivity: Activity Logging for WordPress plugin up to and including version 3.0.
It specifically affects the logging pipeline where request metadata (including the User-Agent HTTP header) is stored in the logmeta table and later retrieved and passed through maybe_unserialize() inside query_metas().
The issue manifests when administrators access the plugin's Logs page in the WordPress dashboard, at which point maliciously crafted log metadata can be deserialized and processed, causing the fatal error and blocking further access to that page until the malicious entries are removed at the database or application level.
Exploit preconditions
- Attack surface: Public-facing WordPress endpoints that are monitored by the coreActivity logging plugin (e.g., login, failed login, general site access).
- Required access: No authentication is required; any remote user able to send HTTP requests to the site can supply a malicious User-Agent header.
- Trigger point: The attack is triggered when an administrator visits the coreActivity Logs page and the plugin reads logmeta entries, calls
maybe_unserialize()on eachmeta_value, and passes the resulting value intoDeviceDetector::setUserAgent(). - Why exploitation is possible:
- The plugin accepts raw User-Agent header values and stores them without filtering out PHP serialization syntax.
query_metas()blindly callsmaybe_unserialize()on allmeta_valueentries without tracking or validating that those values were serialized by the application.- The resulting unserialized data is used as if it were a valid string and handed to
DeviceDetector::setUserAgent(), which cannot handle unexpected object types and throws a fatal TypeError, resulting in a persistent denial of service for the Logs page.
Why this happens
This vulnerability stems from unsafe deserialization of untrusted input, corresponding to CWE-502: Deserialization of Untrusted Data.
The plugin treats the User-Agent header as benign metadata, but fails to:
- Constrain its format to a predictable string.
- Strip or reject PHP serialization syntax before storage.
Later, during log retrieval, the code applies maybe_unserialize() to every meta_value regardless of its origin, thereby implicitly trusting that anything in the field is safe to unserialize.
This pattern—accepting arbitrary user-controlled data, storing it, and then unserializing it in a privileged context—creates an object injection channel.
In this particular case, deserializing attacker-controlled data causes a type mismatch in DeviceDetector::setUserAgent(), yielding a fatal TypeError and blocking admin access to the Logs page, rather than full code execution; however, the underlying pattern is still an unsafe deserialization flaw.
Potential impact
- The Logs page in the WordPress admin dashboard can become permanently inaccessible until the malicious entries are manually removed.
- Administrators may be unable to review or audit activity logs, hampering incident response and monitoring.
- Repeated exploitation can continuously reintroduce the denial of service condition on the logging interface.
- Depending on broader ecosystem and future code changes, similar unsafe deserialization paths could be leveraged for more severe outcomes, such as privilege escalation or code execution.
General mitigation guidance
Effective mitigation focuses on eliminating unsafe deserialization paths and tightening input handling around log metadata:
- Treat HTTP headers, including User-Agent, as untrusted strings and avoid storing them in a format that could be interpreted as serialized PHP data.
- Restrict
maybe_unserialize()usage to clearly defined fields that are known to be application-generated serialized data, rather than applying it generically to all metadata. - Introduce explicit type and format validation for log fields before further processing (e.g., ensure the User-Agent value is a string within bounded length and contains only expected characters).
- When storing complex metadata, favor structured formats that do not support executable constructs, such as JSON, and ensure parsing routines do not invoke any dynamic evaluation.
- Apply defensive coding around third-party library calls (such as
DeviceDetector::setUserAgent()) by validating and normalizing input types and values before invocation. - Run admin-facing log processing logic with robust error handling to prevent a single malformed record from taking down an entire admin page.
How teams detect issues like this
Detection strategies can combine static analysis, code review, and runtime monitoring:
- Static analysis and linters:
- Flag use of
unserialize()andmaybe_unserialize()on data that can originate from request headers, query parameters, cookies, or other user-controlled sources. - Detect generic deserialization of fields without prior origin tracking or serialization markers.
- Code review signals:
- Logging components that ingest raw HTTP headers or request metadata and later deserialize or dynamically interpret stored values.
- Database access patterns that call
maybe_unserialize()on broadly scoped columns such asmeta_valuewithout checking if the data is actually serialized by the application. - Lack of type checks before calling libraries like
DeviceDetector::setUserAgent()or similar parsing utilities. - Policy and tooling:
- Apply secure coding guidelines that prohibit deserialization of untrusted data and require explicit justification for any use of serialization APIs.
- Integrate automated security review tools or SAST solutions into CI pipelines to highlight unsafe deserialization patterns early.
- Runtime and operational monitoring:
- Monitor PHP error logs for recurring fatal TypeErrors originating from the logging plugin or admin log views.
- Set alerts on spikes in errors tied to deserialization functions, which can indicate active exploitation attempts.

