Atomic Edge analysis of CVE-2026-129323: This is an authenticated (Subscriber+) Stored Cross-Site Scripting vulnerability in the Masteriyo LMS plugin versions up to and including 3.5.1. The flaw resides in the ‘content’ parameter of the course review submission. Due to insufficient input sanitization and output escaping, an attacker with the ability to submit course reviews can inject arbitrary JavaScript that executes in the browser of any user viewing the compromised page. The CVSS score is 6.4 (Medium), and the CWE is 79 (Improper Neutralization of Input During Web Page Generation). On a default installation, unauthenticated visitors can self-register as students, obtaining the necessary capability to submit reviews.
Root Cause: The vulnerability stems from the lack of proper sanitization and escaping of the course review content when it is stored and later displayed. In the vulnerable code, the REST API controller `CourseReviewsController.php` (lines around 695-696) sets the title using `set_title( $request[‘title’] )` without sanitization, but the content parameter is handled without applying WordPress’s `pre_comment_content` filter, which normally applies KSES for users without `unfiltered_html` capability. The repository classes (`CourseReviewRepository.php` and others) directly insert the content using `wp_insert_comment()` without filtering. Similarly, the update methods call `wp_update_comment()` without applying the filter, and the model retains the unsanitized content. The patch adds `apply_filters( ‘pre_comment_content’, … )` before inserting or updating, and uses `wp_unslash` to match the stored data. Additionally, the patch sanitizes the title with `sanitize_text_field` and marks the `type` parameter as read-only to prevent tampering.
Exploitation: An attacker with subscriber-level access (or any unauthenticated user who can self-register as a student via the plugin’s public `/account/signup/` form) can submit a course review through the REST API endpoint `/wp-json/masteriyo/v1/course-reviews` (or the corresponding admin-ajax handler). The attacker sends a POST request with a JSON payload containing the `content` parameter set to a malicious script, such as `alert(document.cookie)`. The review is stored unsanitized. When an administrator or any other user views the course page where the review is displayed, the script executes in their browser. The patch prevents this by applying KSES filtering to the content before storage.
Patch Analysis: The patch in version 3.5.2 introduces proper sanitization for course review content. In `CourseReviewRepository.php`, before calling `wp_insert_comment()`, the code now applies the `pre_comment_content` filter, which runs KSES for users without `unfiltered_html` capability, and then uses `wp_unslash` to ensure consistency. For updates, after `wp_update_comment()`, the model’s content is refreshed from the database to reflect any filtering. The same changes are applied to `LessonReviewRepository.php`, `QuizReviewRepository.php`, and `CourseQuestionAnswerRepository.php`. Additionally, the `CourseReviewsController.php` now sanitizes the title with `sanitize_text_field` and marks the `type` parameter as read-only, preventing manipulation. The patch also includes other unrelated security hardening measures, such as improved unserialization checks and permission verifications.
Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of any user viewing the injected review, including administrators. This can lead to session hijacking, theft of cookies, privilege escalation, or redirection to malicious sites. The attacker could also perform actions on behalf of the victim, such as creating new administrative accounts or modifying content. Given the self-registration capability, the vulnerability is easily exploitable without authentication on default installations. The CVSS score of 6.4 reflects the medium severity due to the required user interaction and limited scope, but the real-world impact can be severe.

