VYPR
Medium severity4.3NVD Advisory· Published May 22, 2016· Updated May 6, 2026

CVE-2016-2159

CVE-2016-2159

Description

The save_submission function in mod/assign/externallib.php in Moodle through 2.6.11, 2.7.x before 2.7.13, 2.8.x before 2.8.11, 2.9.x before 2.9.5, and 3.0.x before 3.0.3 allows remote authenticated users to bypass intended due-date restrictions by leveraging the student role for a web-service request.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
moodle/moodlePackagist
>= 2.7, < 2.7.132.7.13
moodle/moodlePackagist
>= 2.8, < 2.8.112.8.11
moodle/moodlePackagist
>= 2.9, < 2.9.52.9.5
moodle/moodlePackagist
>= 3.0, < 3.0.33.0.3

Affected products

33
  • Moodle/Moodle33 versions
    cpe:2.3:a:moodle:moodle:2.8.8:*:*:*:*:*:*:*+ 32 more
    • cpe:2.3:a:moodle:moodle:2.8.8:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:*:*:*:*:*:*:*:*range: <=2.6.11
    • cpe:2.3:a:moodle:moodle:2.7.0:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.1:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.2:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.3:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.4:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.5:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.6:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.7:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.8:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.9:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.10:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.11:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.7.12:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.0:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.1:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.2:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.3:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.4:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.5:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.6:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.7:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.9:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.8.10:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.9.0:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.9.1:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.9.2:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.9.3:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:2.9.4:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:3.0.0:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:3.0.1:*:*:*:*:*:*:*
    • cpe:2.3:a:moodle:moodle:3.0.2:*:*:*:*:*:*:*

Patches

5
0766509ab023

MDL-52774 ajax: Require authentication when getting nav branch

https://github.com/moodle/moodleKrista KoivistoFeb 4, 2016via ghsa
1 file changed · +4 0
  • lib/ajax/getnavbranch.php+4 0 modified
    @@ -32,6 +32,10 @@
     /** Include course lib for its functions */
     require_once($CFG->dirroot.'/course/lib.php');
     
    +if (!empty($CFG->forcelogin)) {
    +    require_login();
    +}
    +
     try {
         // Start buffer capture so that we can `remove` any errors
         ob_start();
    
3c069c16db62

MDL-52774 ajax: Require authentication when getting nav branch

https://github.com/moodle/moodleKrista KoivistoFeb 4, 2016via ghsa
1 file changed · +4 0
  • lib/ajax/getnavbranch.php+4 0 modified
    @@ -32,6 +32,10 @@
     /** Include course lib for its functions */
     require_once($CFG->dirroot.'/course/lib.php');
     
    +if (!empty($CFG->forcelogin)) {
    +    require_login();
    +}
    +
     try {
         // Start buffer capture so that we can `remove` any errors
         ob_start();
    
dc8421575f35

MDL-52774 ajax: Require authentication when getting nav branch

https://github.com/moodle/moodleKrista KoivistoFeb 4, 2016via ghsa
1 file changed · +4 0
  • lib/ajax/getnavbranch.php+4 0 modified
    @@ -32,6 +32,10 @@
     /** Include course lib for its functions */
     require_once($CFG->dirroot.'/course/lib.php');
     
    +if (!empty($CFG->forcelogin)) {
    +    require_login();
    +}
    +
     try {
         // Start buffer capture so that we can `remove` any errors
         ob_start();
    
ea8987644fdb

MDL-52774 ajax: Require authentication when getting nav branch

https://github.com/moodle/moodleKrista KoivistoFeb 4, 2016via ghsa
1 file changed · +4 0
  • lib/ajax/getnavbranch.php+4 0 modified
    @@ -32,6 +32,10 @@
     /** Include course lib for its functions */
     require_once($CFG->dirroot.'/course/lib.php');
     
    +if (!empty($CFG->forcelogin)) {
    +    require_login();
    +}
    +
     try {
         // Start buffer capture so that we can `remove` any errors
         ob_start();
    
711f9468d4e2

MDL-52901 mod_assign: Check due dates in external save_submission

https://github.com/moodle/moodleJuan LeyvaJan 27, 2016via ghsa
2 files changed · +16 3
  • mod/assign/externallib.php+6 3 modified
    @@ -1681,9 +1681,12 @@ public static function save_submission($assignmentid, $plugindata) {
     
             $notices = array();
     
    -        $submissiondata = (object)$params['plugindata'];
    -
    -        $assignment->save_submission($submissiondata, $notices);
    +        if (!$assignment->submissions_open($USER->id)) {
    +            $notices[] = get_string('duedatereached', 'assign');
    +        } else {
    +            $submissiondata = (object)$params['plugindata'];
    +            $assignment->save_submission($submissiondata, $notices);
    +        }
     
             $warnings = array();
             foreach ($notices as $notice) {
    
  • mod/assign/tests/externallib_test.php+10 0 modified
    @@ -946,6 +946,16 @@ public function test_save_submission() {
     
             $this->assertEquals(0, count($result));
     
    +        // Set up a due and cutoff passed date.
    +        $instance->duedate = time() - WEEKSECS;
    +        $instance->cutoffdate = time() - WEEKSECS;
    +        $DB->update_record('assign', $instance);
    +
    +        $result = mod_assign_external::save_submission($instance->id, $submissionpluginparams);
    +        $result = external_api::clean_returnvalue(mod_assign_external::save_submission_returns(), $result);
    +
    +        $this->assertCount(1, $result);
    +        $this->assertEquals(get_string('duedatereached', 'assign'), $result[0]['item']);
         }
     
         /**
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

11

News mentions

0

No linked articles in our index yet.