Moodle versions up to 5.3.0, including 5.2.4, 5.1.8, 5.0.11, and 4.5.15, contain an SQL injection vulnerability in the External database enrolment plugin via the course idnumber field. This flaw allows editing teachers to inject a payload that executes during scheduled synchronization with MySQL/MariaDB external databases, potentially reading data and manipulating enrolment results. The vulnerability is fixed in Moodle 5.3.1.