Vulnerabilities > CVE-2009-0542 - SQL Injection vulnerability in Proftpd Project Proftpd 1.3.1/1.3.2/1.3.2Rc2

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
proftpd-project
CWE-89
nessus
exploit available

Summary

SQL injection vulnerability in ProFTPD Server 1.3.1 through 1.3.2rc2 allows remote attackers to execute arbitrary SQL commands via a "%" (percent) character in the username, which introduces a "'" (single quote) character during variable substitution by mod_sql.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • 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.
  • Object Relational Mapping Injection
    An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject his or her own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still possible.
  • SQL Injection through SOAP Parameter Tampering
    An attacker modifies the parameters of the SOAP message that is sent from the service consumer to the service provider to initiate a SQL injection attack. On the service provider side, the SOAP message is parsed and parameters are not properly validated before being used to access a database in a way that does not use parameter binding, thus enabling the attacker to control the structure of the executed SQL query. This pattern describes a SQL injection attack with the delivery mechanism being a SOAP message.
  • Expanding Control over the Operating System from the Database
    An attacker is able to leverage access gained to the database to read / write data to the file system, compromise the operating system, create a tunnel for accessing the host machine, and use this access to potentially attack other machines on the same network as the database machine. Traditionally SQL injections attacks are viewed as a way to gain unauthorized read access to the data stored in the database, modify the data in the database, delete the data, etc. However, almost every data base management system (DBMS) system includes facilities that if compromised allow an attacker complete access to the file system, operating system, and full access to the host running the database. The attacker can then use this privileged access to launch subsequent attacks. These facilities include dropping into a command shell, creating user defined functions that can call system level libraries present on the host machine, stored procedures, etc.
  • SQL Injection
    This attack exploits target software that constructs SQL statements based on user input. An attacker crafts input strings so that when the target software constructs SQL statements based on the input, the resulting SQL statement performs actions other than those the application intended. SQL Injection results from failure of the application to appropriately validate input. When specially crafted user-controlled input consisting of SQL syntax is used without proper validation as part of SQL queries, it is possible to glean information from the database in ways not envisaged during application design. Depending upon the database and the design of the application, it may also be possible to leverage injection to have the database execute system-related commands of the attackers' choice. SQL Injection enables an attacker to talk directly to the database, thus bypassing the application completely. Successful injection can cause information disclosure as well as ability to add or modify data in the database. In order to successfully inject SQL and retrieve information from a database, an attacker:

Exploit-Db

  • descriptionProFTPd with mod_mysql Authentication Bypass Vulnerability. CVE-2009-0542,CVE-2009-0543. Remote exploits for multiple platform
    fileexploits/multiple/remote/8037.txt
    idEDB-ID:8037
    last seen2016-02-01
    modified2009-02-10
    platformmultiple
    port
    published2009-02-10
    reportergat3way
    sourcehttps://www.exploit-db.com/download/8037/
    titleProFTPd with mod_mysql - Authentication Bypass Vulnerability
    typeremote
  • descriptionProFTPD 1.3 'mod_sql' Username SQL Injection Vulnerability. CVE-2009-0542. Remote exploits for multiple platform
    idEDB-ID:32798
    last seen2016-02-03
    modified2009-02-10
    published2009-02-10
    reporterAlpHaNiX
    sourcehttps://www.exploit-db.com/download/32798/
    titleProFTPD 1.3 - 'mod_sql' Username SQL Injection Vulnerability

Nessus

  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2009-9386.NASL
    descriptionThis update has a large number of changes from previous Fedora packages; the highlights are as follows: - Update to upstream release 1.3.2a - Fix SQL injection vulnerability at login (#485125, CVE-2009-0542) - Fix SELinux compatibility (#498375) - Fix audit logging (#506735) - Fix default configuration (#509251) - Many new loadable modules including mod_ctrls_admin and mod_wrap2 - National Language Support (RFC 2640) - Enable/disable common features in /etc/sysconfig/proftpd Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id41609
    published2009-09-25
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/41609
    titleFedora 10 : proftpd-1.3.2a-5.fc10 (2009-9386)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Fedora Security Advisory 2009-9386.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(41609);
      script_version ("1.15");
      script_cvs_date("Date: 2019/08/02 13:32:30");
    
      script_cve_id("CVE-2009-0542");
      script_bugtraq_id(33722);
      script_xref(name:"FEDORA", value:"2009-9386");
    
      script_name(english:"Fedora 10 : proftpd-1.3.2a-5.fc10 (2009-9386)");
      script_summary(english:"Checks rpm output for the updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Fedora host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update has a large number of changes from previous Fedora
    packages; the highlights are as follows: - Update to upstream release
    1.3.2a - Fix SQL injection vulnerability at login (#485125,
    CVE-2009-0542) - Fix SELinux compatibility (#498375) - Fix audit
    logging (#506735) - Fix default configuration (#509251) - Many new
    loadable modules including mod_ctrls_admin and mod_wrap2 - National
    Language Support (RFC 2640) - Enable/disable common features in
    /etc/sysconfig/proftpd
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Fedora security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=485125"
      );
      # https://lists.fedoraproject.org/pipermail/package-announce/2009-September/029447.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?d4405a83"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected proftpd package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
      script_set_attribute(attribute:"canvas_package", value:'D2ExploitPack');
      script_cwe_id(89);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:proftpd");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:10");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2009/09/09");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/09/25");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Fedora Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora");
    os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora");
    os_ver = os_ver[1];
    if (! ereg(pattern:"^10([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 10.x", "Fedora " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Fedora", cpu);
    
    flag = 0;
    if (rpm_check(release:"FC10", reference:"proftpd-1.3.2a-5.fc10")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get());
      else security_hole(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "proftpd");
    }
    
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_CA0841FF125411DEA9640030843D3802.NASL
    descriptionSecunia reports : Some vulnerabilities have been reported in ProFTPD, which can be exploited by malicious people to conduct SQL injection attacks. The application improperly sets the character encoding prior to performing SQL queries. This can be exploited to manipulate SQL queries by injecting arbitrary SQL code in an environment using a multi-byte character encoding. An error exists in the
    last seen2020-06-01
    modified2020-06-02
    plugin id35941
    published2009-03-17
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/35941
    titleFreeBSD : proftpd -- multiple sql injection vulnerabilities (ca0841ff-1254-11de-a964-0030843d3802)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-1727.NASL
    descriptionTwo SQL injection vulnerabilities have been found in proftpd, a virtual-hosting FTP daemon. The Common Vulnerabilities and Exposures project identifies the following problems : - CVE-2009-0542 Shino discovered that proftpd is prone to a SQL injection vulnerability via the use of certain characters in the username. - CVE-2009-0543 TJ Saunders discovered that proftpd is prone to a SQL injection vulnerability due to insufficient escaping mechanisms, when multybite character encodings are used.
    last seen2020-06-01
    modified2020-06-02
    plugin id35739
    published2009-02-26
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/35739
    titleDebian DSA-1727-1 : proftpd-dfsg - SQL injection vulnerabilites
  • NASL familyFTP
    NASL idPROFTPD_USER_SQL_INJECTION.NASL
    descriptionThe remote host is using ProFTPD, a free FTP server for Unix and Linux. The variable substitution feature in the version of ProFTPD running on the remote host can be abused to conduct a SQL injection attack. For example, a remote attacker can bypass authentication using a specially crafted username containing a percent sign character (
    last seen2020-06-01
    modified2020-06-02
    plugin id35690
    published2009-02-17
    reporterThis script is Copyright (C) 2009-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/35690
    titleProFTPD Username Variable Substitution SQL Injection
  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2009-061.NASL
    descriptionmultiple vulnerabilities has been identified and fixed in proftpd : ProFTPD 1.3.1 interprets long commands from an FTP client as multiple commands, which allows remote attackers to conduct cross-site request forgery (CSRF) attacks and execute arbitrary FTP commands via a long ftp:// URI that leverages an existing session from the FTP client implementation in a web browser. (CVE-2008-4242) SQL injection vulnerability in ProFTPD Server 1.3.1 through 1.3.2rc2 allows remote attackers to execute arbitrary SQL commands via a
    last seen2020-06-01
    modified2020-06-02
    plugin id37354
    published2009-04-23
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/37354
    titleMandriva Linux Security Advisory : proftpd (MDVSA-2009:061)
  • NASL familyFTP
    NASL idPROFTPD_1_3_3D.NASL
    descriptionThe remote host is using ProFTPD, a free FTP server for Unix and Linux. According to its banner, the version of ProFTPD installed on the remote host is earlier than 1.3.3d. Such versions are reportedly affected by a heap-based buffer overflow vulnerability in the function
    last seen2020-03-28
    modified2010-12-23
    plugin id51366
    published2010-12-23
    reporterThis script is Copyright (C) 2010-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/51366
    titleProFTPD < 1.3.3d 'mod_sql' Buffer Overflow
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-1730.NASL
    descriptionThe security update for proftpd-dfsg in DSA-1727-1 caused a regression with the postgresql backend. This update corrects the flaw. Also it was discovered that the oldstable distribution (etch) is not affected by the security issues. For reference the original advisory follows. Two SQL injection vulnerabilities have been found in proftpd, a virtual-hosting FTP daemon. The Common Vulnerabilities and Exposures project identifies the following problems : - CVE-2009-0542 Shino discovered that proftpd is prone to a SQL injection vulnerability via the use of certain characters in the username. - CVE-2009-0543 TJ Saunders discovered that proftpd is prone to a SQL injection vulnerability due to insufficient escaping mechanisms, when multybite character encodings are used. The oldstable distribution (etch) is not affected by these problems.
    last seen2020-06-01
    modified2020-06-02
    plugin id35755
    published2009-03-03
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/35755
    titleDebian DSA-1730-1 : proftpd-dfsg - SQL injection vulnerabilites
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200903-27.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200903-27 (ProFTPD: Multiple vulnerabilities) The following vulnerabilities were reported: Percent characters in the username are not properly handled, which introduces a single quote character during variable substitution by mod_sql (CVE-2009-0542). Some invalid, encoded multibyte characters are not properly handled in mod_sql_mysql and mod_sql_postgres when NLS support is enabled (CVE-2009-0543). Impact : A remote attacker could send specially crafted requests to the server, possibly resulting in the execution of arbitrary SQL statements. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id35917
    published2009-03-13
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/35917
    titleGLSA-200903-27 : ProFTPD: Multiple vulnerabilities