eLearning-BS23 / moodle-auth_otp

Moodle auth_otp is a One time password (OTP) based authentication plugin.
6 stars 3 forks source link

Improve security of SQL queries #2

Open tmuras opened 3 years ago

tmuras commented 3 years ago

Please use placeholders when doing SQL queries. For example:

$data = $DB->execute("UPDATE {auth_otp_linked_login} SETconfirmtoken= null,otpcreated= null wherephone= '" . $phone . "'"); $sql = 'select * from {auth_otp_linked_login} wherephone= ' . $username . ' ANDconfirmtoken= ' . $password; Instead of the second query, you can use $DB->get_records(). See https://docs.moodle.org/dev/Security:SQL_injection

danmarsden commented 2 years ago

this isn't fixed either... and it's a definite blocker.