[UNIX] Moodle Cross Site Scripting Vulnerability (post.php)

From: SecuriTeam (support_at_securiteam.com)
Date: 08/11/04

  • Next message: SecuriTeam: "[NEWS] Free Web Chat Multiple Vulnerabilities"
    To: list@securiteam.com
    Date: 11 Aug 2004 18:02:45 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      Moodle Cross Site Scripting Vulnerability (post.php)
    ------------------------------------------------------------------------

    SUMMARY

    " <http://www.moodle.org> Moodle is a course management system (CMS) - a
    software package designed to help educators create quality online
    courses."

    Moodle suffers from a cross-site scripting vulnerability due to handling
    of user supplied parameters in an unsafe manner.

    DETAILS

    Vulnerable Systems:
     * Moodle versions 1.3 and prior

    Immune Systems:
     * Moodle version 1.3.3

    The cross-site scripting (XSS) vulnerability is caused by un-filtering the
    $reply variable. Here is an excerpt from the original code:
    /* Begin of vulnerable code */

      } else if (isset($reply)) { // User is writing a new reply

        if (! $parent = forum_get_post_full($reply)) {
          error("Parent post ID was incorrect ($reply)");
        }
        if (! $discussion = get_record("forum_discussions", "id",
    $parent->discussion)) {
          error("This post is not part of a discussion! ($reply)");
        }
        if (! $forum = get_record("forum", "id", $discussion->forum)) {
          error("The forum number was incorrect ($discussion->forum)");
        }
        if (! $course = get_record("course", "id", $discussion->course)) {
          error("The course number was incorrect ($discussion->course)");
        }

        if (! forum_user_can_post($forum)) {
          error("Sorry, but you can not post in this forum.");
        }

        if ($cm = get_coursemodule_from_instance("forum", $forum->id,
    $course->id)) {
          if (groupmode($course, $cm) and !isteacheredit($course->id)) { //
    Make sure user can post here
            if (mygroupid($course->id) != $discussion->groupid) {
              error("Sorry, but you can not post in this discussion.");
            }
          }
          if (!$cm->visible and !isteacher($course->id)) {
            error(get_string("activityiscurrentlyhidden"));
          }
        }

    /* End of vulnerable code */

    The bug can be specifically traced to the following snippet of code:
    if (! $parent = forum_get_post_full($reply)) {
          error("Parent post ID was incorrect ($reply)");

    A proof of concept HTTP request that will pop up an alert dialog in the
    victim's context:
    http://www.vulnerable.com/moodle/mod/forum/post.php?reply=%3Cscript%3Ealert(document.cookie);%3C/script%3E

    Vendor Status:
    The vendor has been contacted and a new version is available for download.

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:javierubilla@spymac.com>
    Javier Ubilla Brenni.

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[NEWS] Free Web Chat Multiple Vulnerabilities"

    Relevant Pages

    • [UNIX] Trend Micro VirusWall Buffer Overflow in VSAPI Library
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... buffer overflow vulnerability in VSAPI library allows arbitrary code ... is called "vscan" which is set suid root by default. ... permissions and thus granted all local users the privilege to execute the ...
      (Securiteam)
    • [UNIX] SCO Multiple Local Buffer Overflow
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Local exploitation of a buffer overflow vulnerability in the ppp binary, ... allows attackers to gain root privileges. ...
      (Securiteam)
    • [NT] Microsoft Word 6.0/95 Document Converter Buffer Overflow (MS04-041)
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... WordPad is "a word processing application that uses the MFC rich edit ... Remote exploitation of a buffer overflow vulnerability in Microsoft ... Microsoft Word format files into the Rich Text Format natively handled by ...
      (Securiteam)
    • [UNIX] Tikiwiki Command Injection and Arbitrary File Exposure Vulnerabilities
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Two security vulnerabilities have been recently discovered in Tikiwiki, ... Remote exploitation of an input validation vulnerability in Tikiwiki ... allows attackers to gain access to arbitrary files on the vulnerable ...
      (Securiteam)
    • [NT] Ipswitch Multiple Vulnerabilities (IMail IMAP LIST Command DoS, Collaboration Suite SMTP Format
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Ipswitch Multiple Vulnerabilities (IMail IMAP LIST Command DoS, ... Collaboration Suite SMTP Format String) ... Remote exploitation of a denial of service vulnerability in Ipswitch ...
      (Securiteam)