Atomic Edge analysis of CVE-2026-124990: This is an unauthenticated PHP Object Injection vulnerability in the Masteriyo LMS plugin versions up to and including 3.5.1. The flaw resides in the course importer component, specifically in the set_post_metas() method, which calls maybe_unserialize() on attacker-controlled postmeta values from an uploaded JSON import file. This allows an attacker to inject arbitrary PHP objects, potentially leading to remote code execution if a suitable gadget chain exists. The CVSS score is 9.8 (Critical), and the vulnerability is classified as CWE-502 (Deserialization of Untrusted Data). Exploitation by unauthenticated attackers requires non-default settings: enable_instructor_registration=true and enable_guest_checkout=true, and at least one purchasable course. On default installations, author-level access is required.
Root Cause: The root cause is the unsafe deserialization of untrusted input in the course importer. In learning-management-system/includes/Importer/CourseImporter.php, the set_post_metas() method (lines around 285-313) iterates over postmeta values and calls maybe_unserialize() on each value without validating that the resulting data contains no malicious objects. Similarly, set_term_metas() (lines around 775-788) does the same for term meta. The QuizImporter.php (lines around 166-176) and QuizzesImportExportController.php (lines around 611-620 and 661-670) also use maybe_unserialize() on imported meta values. The WXRImporter.php (lines around 1051 and 1427) uses maybe_unserialize() on meta values from WXR files. These unsanitized deserializations allow PHP Object Injection. The patch introduces a new function masteriyo_unserialize_import_value() in includes/Helper/serialize.php, which uses masteriyo_maybe_unserialize() (a safe unserializer that only allows specific classes) and checks for disallowed objects at depth with limits to prevent DoS. It also adds a check for serialized strings that are refused by the safe unserializer. The importer code is updated to use this new function and skip values that return null (indicating disallowed objects). Additionally, the patch hardens other areas: it adds a capability check and path validation for SCORM imports (ScormController.php), fixes authorization in QuizAttemptsController.php, and improves sanitization in review repositories.
Exploitation: An attacker can exploit this vulnerability by crafting a malicious JSON import file containing serialized PHP objects in postmeta values. The attacker must access the course import functionality, which is available to unauthenticated users if the site has enable_instructor_registration=true and enable_guest_checkout=true and at least one purchasable course. Otherwise, an author-level user can exploit it. The attacker uploads the JSON file via the import endpoint (likely a REST API endpoint such as /wp-json/masteriyo/v1/courses/import or similar, though the exact endpoint is not specified in the diff). The importer processes the file, and when it reaches set_post_metas(), it calls maybe_unserialize() on the attacker-supplied string, instantiating arbitrary objects. A typical payload would be a serialized string like O:14:”SomeClass”:1:{…} that, when unserialized, triggers a gadget chain leading to remote code execution or other malicious actions. The patch prevents this by using a safe unserializer and rejecting values containing disallowed objects.
Patch Analysis: The patch fixes the vulnerability by replacing all instances of maybe_unserialize() on import data with masteriyo_unserialize_import_value(), which uses masteriyo_maybe_unserialize(). This function only allows a whitelist of classes (MasteriyoDateTime and stdClass) and recursively checks for disallowed objects with depth and count limits. If a disallowed object is found, the function returns null, and the importer skips that meta value. The patch also adds validation to ensure that serialized strings that cannot be safely unserialized are rejected. Additionally, the patch hardens related areas: it adds path traversal protection and symlink checks in SCORM imports, enforces proper capability checks, and sanitizes review content. These changes collectively prevent PHP Object Injection and related attacks.
Impact: If exploited, this vulnerability allows an attacker to perform PHP Object Injection, which can lead to remote code execution if a POP chain is present in the plugin or other installed components. Even without RCE, an attacker could manipulate internal data, escalate privileges, or cause denial of service. The unauthenticated exploitation path (under specific settings) makes this critical for sites with instructor registration and guest checkout enabled. The patch prevents this by blocking the deserialization of malicious objects, thereby mitigating the risk.

