Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve security of SQL queries #2

Open
tmuras opened this issue Oct 15, 2021 · 1 comment
Open

Improve security of SQL queries #2

tmuras opened this issue Oct 15, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@tmuras
Copy link

tmuras commented Oct 15, 2021

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

@sahedbs23 sahedbs23 added the enhancement New feature or request label Oct 16, 2021
@danmarsden
Copy link

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

sinthy08 added a commit that referenced this issue Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants