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

SQL injection vulnerability #3

Open
james-voong opened this issue Jul 18, 2018 · 4 comments
Open

SQL injection vulnerability #3

james-voong opened this issue Jul 18, 2018 · 4 comments

Comments

@james-voong
Copy link

The function grab_tagged_items in block_equella_links.php is vulnerable to SQL injections. xmlpath is a text field which isn't sanitised sufficiently to prevent injection and idnumber can also be injected into. Use of a prepared statement would alleviate this.

nelson-edalex added a commit that referenced this issue Jul 20, 2018
nelson-edalex added a commit that referenced this issue Jul 20, 2018
This reverts commit eff5f81.
nelson-edalex added a commit that referenced this issue Jul 20, 2018
nelson-edalex added a commit that referenced this issue Jul 20, 2018
@danmarsden
Copy link

filter_var is better than doing nothing, although it might have been nice to use the moodle clean_param function which is more restrictive.

@danmarsden
Copy link

you shouldn't need to add the sanitisation here:
eff5f81#diff-7ff30c81b131dcf5e0b431dba0483755R45

because you are using mform which should already sanitise the vars with setype on the form definition and they will already be safe to use. it is also using standard db functions for insert which will also prevent any injection etc.

@danmarsden
Copy link

just in case that wasn't clear... set_type in the form definition here:
https://github.com/equella/moodle-block_equella_links/blob/master/link_edit_form.php#L29
forces the param cleaning so that when you call $mform->get_data() you can trust the output of the form.

@nelson-edalex
Copy link
Contributor

Unnecessary filter removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants