ResearchVulnCrest analysis

PHP Object Injection in ELEX HelpDesk: When a Ticket Field Becomes an unserialize() Primitive

A walk through the unauthenticated PHP Object Injection bug in the ELEX HelpDesk ticket plugin (fixed in 3.4.0): how raw custom-field values land in ticket meta and reach unserialize(), why a public AJAX handler made it reachable, and what defenders should change.

A public write path into stored ticket meta#

The ELEX HelpDesk plugin registers a ticket-submission action twice: once for logged-in users, and once through the wp_ajax_nopriv_eh_crm_new_ticket_post hook. That second registration is what makes this bug interesting — any anonymous visitor who can reach admin-ajax.php can invoke the handler, provided they pass the nonce the plugin exposes on public support pages via the localised support_object.nonce object.

The handler itself is not unusual. It takes the form parameter, runs it through parse_str(), iterates the resulting keys, and keeps only those that match a configured custom ticket-field slug. If the key matches, the value is copied into the meta array that eh_crm_insert_ticket() eventually persists. There is no type check, no sanitisation, and no serialized-object guard on the value at this point.

Where the defect actually lives#

The bug is a missing serialized-object guard between a public input and a stored unserialize sink, not a problem with the AJAX registration alone. The write happens in eh_crm_insert_ticketmeta(), which serialises arrays but otherwise stores scalar values verbatim into wp_wsdesk_ticketsmeta.meta_value:

  • is_array( $value ) → serialize( $value )
  • otherwise → the raw string is inserted as-is

So an attacker-supplied string such as a serialized PHP object is written straight into the database without any inspection. The plugin later treats that column as trusted data.

The sink side: reading meta as if it were always safe#

When a ticket is rendered, the plugin runs the stored meta_value through unserialize() or maybe_unserialize() in several places. The clearest examples are in includes/Tickets/TicketField.php, includes/Formatter/Cast/ObjectCaster.php, and includes/class-crm-public-functions.php (around lines 875 and 902).

Because the attacker controls the exact bytes that reach those calls, the installed code base effectively offers an object-instantiation primitive reachable without authentication. Whether that becomes remote code execution depends entirely on which gadget chains are loaded — other plugins, themes, and libraries all contribute to that surface. The CWE here is CWE-502, and the CVSS severity reflects that at minimum it is an object-instantiation primitive, and at worst it is RCE.

The fix in 3.4.0: two helpers, applied everywhere#

The 3.4.0 patch introduces eh_crm_has_object_or_serialized_object() and eh_crm_safe_unserialize() and then applies them systematically.

  1. Input rejection. In eh_crm_new_ticket_post, any value that trips eh_crm_has_object_or_serialized_object() or is_serialized() is skipped with continue rather than stored.
  2. Key and value sanitisation. The sibling handlers in class-crm-ajax-functions.php and class-crm-ajax-functions-three.php now normalise keys with sanitize_key() and map values through sanitize_text_field() / sanitize_textarea_field() before writing meta.
  3. Safe sinks. Every unserialize() / maybe_unserialize() call on stored ticket meta was replaced with eh_crm_safe_unserialize(), which refuses to instantiate objects.

The net effect is defence in depth: rejected on input, and inert even if it somehow reaches storage.

What defenders should take from this#

This pattern is common in WordPress plugins that grew organically: a public endpoint, a flexible field schema, and a legacy meta column that a later feature decided to unserialize. The mistake is trusting data because it “came from a field we defined” — the attacker controls the value, not the slug.

  • Do not call unserialize() on anything that originated from a request, a meta column, or a transient without allowed_classes restrictions.
  • Enforce a schema on write: if a field is a string field, it is stored as a string and validated as a string.
  • Treat every wp_ajax_nopriv_* action as an untrusted entry point and review its downstream data flow, including anything in $wpdb->insert.
  • When auditing, grep for unserialize(, maybe_unserialize(, eval(, and call_user_func on values that trace back to $_POST or custom meta.

Storing attacker-controlled input verbatim and later calling unserialize() on it is the same bug regardless of how many layers of “our own field” abstraction sit in between — validate at the boundary, and never instantiate objects from stored data.

Vulnerabilities covered in this article
SeverityVulnerabilityCVEPublished
Critical9.8Unauthenticated PHP Object Injection to Remote Code Execution via 'form' ParameterCVE-2026-119077

Search VulnCrest Radar

Are you sure?