The "restore teacher" feature in Moodle 3.0 through 3.0.3, 2.9 through 2.9.5, 2.8 through 2.8.11, 2.7 through 2.7.13, and earlier allows remote authenticated users to overwrite the course idnumber.
https://bugzilla.redhat.com/show_bug.cgi?id=1335933
http://www.securitytracker.com/id/1035902
http://www.openwall.com/lists/oss-security/2016/05/17/4
http://git.moodle.org/gw?p=moodle.git&a=search&h=HEAD&st=commit&s=MDL-51369