Vulnerabilities > CVE-2009-1171 - Improper Input Validation vulnerability in Moodle

Attack vector
Attack complexity
Privileges required
Confidentiality impact
Integrity impact
Availability impact
exploit available


The TeX filter in Moodle 1.6 before 1.6.9+, 1.7 before 1.7.7+, 1.8 before 1.8.9, and 1.9 before 1.9.5 allows user-assisted attackers to read arbitrary files via an input command in a "$$" sequence, which causes LaTeX to include the contents of the file.

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Server Side Include (SSI) Injection
    An attacker can use Server Side Include (SSI) Injection to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.
  • Cross Zone Scripting
    An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security. In a zone-based model, pages belong to one of a set of zones corresponding to the level of privilege assigned to that page. Pages in an untrusted zone would have a lesser level of access to the system and/or be restricted in the types of executable content it was allowed to invoke. In a cross-zone scripting attack, a page that should be assigned to a less privileged zone is granted the privileges of a more trusted zone. This can be accomplished by exploiting bugs in the browser, exploiting incorrect configuration in the zone controls, through a cross-site scripting attack that causes the attackers' content to be treated as coming from a more trusted page, or by leveraging some piece of system functionality that is accessible from both the trusted and less trusted zone. This attack differs from "Restful Privilege Escalation" in that the latter correlates to the inadequate securing of RESTful access methods (such as HTTP DELETE) on the server, while cross-zone scripting attacks the concept of security zones as implemented by a browser.
  • Cross Site Scripting through Log Files
    An attacker may leverage a system weakness where logs are susceptible to log injection to insert scripts into the system's logs. If these logs are later viewed by an administrator through a thin administrative interface and the log data is not properly HTML encoded before being written to the page, the attackers' scripts stored in the log will be executed in the administrative interface with potentially serious consequences. This attack pattern is really a combination of two other attack patterns: log injection and stored cross site scripting.
  • Command Line Execution through SQL Injection
    An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.


descriptionMoodle < 1.6.9/1.7.7/1.8.9/1.9.5 File Disclosure Vulnerability. CVE-2009-1171. Webapps exploit for php platform
last seen2016-02-01
reporterChristian J. Eibl
titleMoodle < 1.6.9/1.7.7/1.8.9/1.9.5 File Disclosure Vulnerability


  • NASL familySuSE Local Security Checks
    descriptionSpecial command sequences in TeX files allowed users to read arbitrary files (CVE-2009-1171).
    last seen2020-06-01
    plugin id36204
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    titleopenSUSE 10 Security Update : moodle (moodle-6198)
    #%NASL_MIN_LEVEL 80502
    # (C) Tenable Network Security, Inc.
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update moodle-6198.
    # The text description of this plugin is (C) SUSE LLC.
    if (description)
      script_version ("1.8");
      script_cvs_date("Date: 2019/10/25 13:36:36");
      script_name(english:"openSUSE 10 Security Update : moodle (moodle-6198)");
      script_summary(english:"Check for the moodle-6198 patch");
        value:"The remote openSUSE host is missing a security update."
    "Special command sequences in TeX files allowed users to read arbitrary
    files (CVE-2009-1171)."
        value:"Update the affected moodle packages."
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-af");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ar");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-be");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-bg");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-bs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ca");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-cs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-da");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-de");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-de_du");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-el");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-es");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-et");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-eu");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-fa");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-fi");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-fr");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ga");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-gl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-he");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-hi");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-hr");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-hu");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-id");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-is");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-it");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ja");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ka");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-km");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-kn");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ko");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-lt");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-lv");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-mi_tn");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ms");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-nl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-nn");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-no");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-pl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-pt");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ro");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-ru");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-sk");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-sl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-so");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-sq");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-sr");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-sv");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-th");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-tl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-tr");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-uk");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-vi");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:moodle-zh_cn");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:10.3");
      script_set_attribute(attribute:"patch_publication_date", value:"2009/04/17");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/04/21");
      script_copyright(english:"This script is Copyright (C) 2009-2019 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list");
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE10\.3)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "10.3", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    flag = 0;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-af-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ar-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-be-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-bg-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-bs-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ca-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-cs-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-da-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-de-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-de_du-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-el-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-es-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-et-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-eu-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-fa-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-fi-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-fr-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ga-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-gl-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-he-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-hi-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-hr-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-hu-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-id-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-is-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-it-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ja-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ka-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-km-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-kn-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ko-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-lt-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-lv-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-mi_tn-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ms-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-nl-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-nn-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-no-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-pl-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-pt-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ro-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-ru-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-sk-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-sl-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-so-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-sq-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-sr-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-sv-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-th-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-tl-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-tr-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-uk-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-vi-1.8.2-17.14") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"moodle-zh_cn-1.8.2-17.14") ) flag++;
    if (flag)
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "moodle / moodle-af / moodle-ar / moodle-be / moodle-bg / moodle-bs / etc");
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2009-3283.NASL
    descriptionCVE-2009-1171: The TeX filter in Moodle 1.6 before 1.6.9+, 1.7 before 1.7.7+, 1.8 before 1.8.9, and 1.9 before 1.9.5 allows user-assisted attackers to read arbitrary files via an input command in a
    last seen2020-06-01
    plugin id36077
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    titleFedora 9 : moodle-1.9.4-6.fc9 (2009-3283)
  • NASL familyCGI abuses
    descriptionThe TeX filter included with the installed version of Moodle can be exploited to reveal the contents of files on the remote host, subject to the privileges under which the web server operates.
    last seen2020-06-01
    plugin id36050
    reporterThis script is Copyright (C) 2009-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    titleMoodle LaTeX Information Disclosure
  • NASL familyUbuntu Local Security Checks
    descriptionThor Larholm discovered that PHPMailer, as used by Moodle, did not correctly escape email addresses. A local attacker with direct access to the Moodle database could exploit this to execute arbitrary commands as the web server user. (CVE-2007-3215) Nigel McNie discovered that fetching https URLs did not correctly escape shell meta-characters. An authenticated remote attacker could execute arbitrary commands as the web server user, if curl was installed and configured. (CVE-2008-4796, MSA-09-0003) It was discovered that Smarty (also included in Moodle), did not correctly filter certain inputs. An authenticated remote attacker could exploit this to execute arbitrary PHP commands as the web server user. (CVE-2008-4810, CVE-2008-4811, CVE-2009-1669) It was discovered that the unused SpellChecker extension in Moodle did not correctly handle temporary files. If the tool had been locally modified, it could be made to overwrite arbitrary local files via symlinks. (CVE-2008-5153) Mike Churchward discovered that Moodle did not correctly filter Wiki page titles in certain areas. An authenticated remote attacker could exploit this to cause cross-site scripting (XSS), which could be used to modify or steal confidential data of other users within the same web domain. (CVE-2008-5432, MSA-08-0022) It was discovered that the HTML sanitizer,
    last seen2020-06-01
    plugin id39516
    reporterUbuntu Security Notice (C) 2009-2019 Canonical, Inc. / NASL script (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    titleUbuntu 8.04 LTS / 8.10 : moodle vulnerabilities (USN-791-1)
  • NASL familyUbuntu Local Security Checks
    descriptionChristian Eibl discovered that the TeX filter in Moodle allowed any function to be used. An authenticated remote attacker could post a specially crafted TeX formula to execute arbitrary TeX functions, potentially reading any file accessible to the web server user, leading to a loss of privacy. (CVE-2009-1171, MSA-09-0009). Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    plugin id39517
    reporterUbuntu Security Notice (C) 2009-2019 Canonical, Inc. / NASL script (C) 2009-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    titleUbuntu 9.04 : moodle vulnerability (USN-791-2)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2009-3280.NASL
    descriptionCVE-2009-1171: The TeX filter in Moodle 1.6 before 1.6.9+, 1.7 before 1.7.7+, 1.8 before 1.8.9, and 1.9 before 1.9.5 allows user-assisted attackers to read arbitrary files via an input command in a
    last seen2020-06-01
    plugin id36905
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    titleFedora 10 : moodle-1.9.4-6.fc10 (2009-3280)
  • NASL familyDebian Local Security Checks
    descriptionChristian J. Eibl discovered that the TeX filter of Moodle, a web-based course management system, doesn
    last seen2020-06-01
    plugin id36084
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    titleDebian DSA-1761-1 : moodle - missing input sanitization
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_1_MOODLE-090417.NASL
    descriptionSpecial command sequences in TeX files allowed users to read arbitrary files (CVE-2009-1171).
    last seen2020-06-01
    plugin id40277
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    titleopenSUSE Security Update : moodle (moodle-803)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_0_MOODLE-090417.NASL
    descriptionSpecial command sequences in TeX files allowed users to read arbitrary files (CVE-2009-1171).
    last seen2020-06-01
    plugin id40070
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    titleopenSUSE Security Update : moodle (moodle-803)