| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| moodle/moodle | composer | >= 5.0.0-beta, < 5.0.3 | 5.0.3 |
| moodle/moodle | composer | >= 4.5.0-beta, < 4.5.7 | 4.5.7 |
| moodle/moodle | composer | >= 4.2.0-beta, < 4.4.11 | 4.4.11 |
| moodle/moodle | composer | < 4.1.21 | 4.1.21 |
The vulnerability in Moodle's timed assignment feature allowed students to bypass the time restriction by having the timer start automatically upon visiting the submission page, rather than when they explicitly chose to begin. The analysis of the provided patch (commit 78a3fe6c618676dfc53ea538abbfe35e60674eeb) reveals the root cause and the affected functions.
The core of the vulnerability lies in the get_user_submission and get_group_submission functions within public/mod/assign/locallib.php. These functions would check if an assignment had a time limit and if the timer had started. If not, they would immediately set the timestarted field upon page load when the action was 'editsubmission'. This allowed a student to trigger the timer simply by loading the page, then leave and come back later to complete the assignment, exceeding the intended time limit.
The patch rectifies this by introducing an explicit confirmation step. A new begin=1 URL parameter is required to start the timer. The get_user_submission and get_group_submission functions were updated to only start the timer if this parameter is present.
Consequently, the mod_assign\output\user_submission_actionmenu::export_for_template function was modified to add this begin=1 parameter to the URL of the 'Begin assignment' button. Furthermore, the assign::view_edit_submission_page function was updated to prevent direct rendering of the submission form for a timed assignment that has not been started, instead showing a confirmation dialog.
Therefore, the identified functions are directly involved in the vulnerable process of automatically starting the assignment timer. During an exploit, these functions would be present in the stack trace as the student navigates to the submission page of a timed assignment.
assign::get_group_submissionpublic/mod/assign/locallib.php
assign::get_user_submissionpublic/mod/assign/locallib.php
assign::view_edit_submission_pagepublic/mod/assign/locallib.php
mod_assign\output\user_submission_actionmenu::export_for_templatepublic/mod/assign/classes/output/user_submission_actionmenu.php
Ongoing coverage of React2Shell