Vulnerabilities > CVE-2009-0543 - SQL Injection vulnerability in Proftpd 1.3.1
Attack vector
NETWORK Attack complexity
MEDIUM Privileges required
NONE Confidentiality impact
PARTIAL Integrity impact
PARTIAL Availability impact
PARTIAL Summary
ProFTPD Server 1.3.1, with NLS support enabled, allows remote attackers to bypass SQL injection protection mechanisms via invalid, encoded multibyte characters, which are not properly handled in (1) mod_sql_mysql and (2) mod_sql_postgres.
Vulnerable Configurations
Part | Description | Count |
---|---|---|
Application | 1 |
Common Weakness Enumeration (CWE)
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
description | ProFTPd with mod_mysql Authentication Bypass Vulnerability. CVE-2009-0542,CVE-2009-0543. Remote exploits for multiple platform |
file | exploits/multiple/remote/8037.txt |
id | EDB-ID:8037 |
last seen | 2016-02-01 |
modified | 2009-02-10 |
platform | multiple |
port | |
published | 2009-02-10 |
reporter | gat3way |
source | https://www.exploit-db.com/download/8037/ |
title | ProFTPd with mod_mysql - Authentication Bypass Vulnerability |
type | remote |
Nessus
NASL family FTP NASL id PROFTPD_1_3_1_SQL_BYPASS.NASL description The 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 1.3.1x and may be affected by SQL injection protection bypass when NLS support is enabled. last seen 2020-06-01 modified 2020-06-02 plugin id 106750 published 2018-02-12 reporter This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/106750 title ProFTPD 1.3.1 SQL injection protection bypass code # # (C) Tenable Network Security, Inc. # include("compat.inc"); if (description) { script_id(106750); script_version("1.3"); script_cvs_date("Date: 2019/11/08"); script_cve_id("CVE-2009-0543"); script_bugtraq_id(33650); script_name(english:"ProFTPD 1.3.1 SQL injection protection bypass"); script_summary(english:"Checks version of ProFTPD."); script_set_attribute(attribute:"synopsis", value: "The remote FTP server is affected by a mitigation bypass."); script_set_attribute(attribute:"description", value: "The 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 1.3.1x and may be affected by SQL injection protection bypass when NLS support is enabled."); script_set_attribute(attribute:"see_also", value:"http://bugs.proftpd.org/show_bug.cgi?id=3173"); script_set_attribute(attribute:"solution", value: "Upgrade to ProFTPD version 1.3.2 or later."); script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P"); script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C"); script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"); script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C"); script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available"); script_set_attribute(attribute:"exploit_available", value:"true"); script_cwe_id(89); script_set_attribute(attribute:"vuln_publication_date", value:"2009/02/05"); script_set_attribute(attribute:"patch_publication_date", value:"2009/02/05"); script_set_attribute(attribute:"plugin_publication_date", value:"2018/02/12"); script_set_attribute(attribute:"potential_vulnerability", value:"true"); script_set_attribute(attribute:"plugin_type", value:"remote"); script_set_attribute(attribute:"cpe", value:"cpe:/a:proftpd:proftpd"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"FTP"); script_copyright(english:"This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof."); script_dependencies("ftp_overflow.nasl", "ftpserver_detect_type_nd_version.nasl"); script_require_keys("ftp/proftpd", "Settings/ParanoidReport"); script_require_ports("Services/ftp", 21); exit(0); } include("audit.inc"); include("ftp_func.inc"); include("global_settings.inc"); if (report_paranoia < 2) audit(AUDIT_PARANOID); port = get_ftp_port(default: 21, broken:TRUE); app = "ProFTPD"; banner = get_ftp_banner(port:port); if (!banner) audit(AUDIT_NO_BANNER, port); if (app >!< banner) audit(AUDIT_NOT_DETECT, app, port); matches = pregmatch(string:banner, pattern:"ProFTPD ([0-9a-z.]+) "); if (isnull(matches)) audit(AUDIT_SERVICE_VER_FAIL, app, port); version = matches[1]; if (version =~ '^1(\\.3)?$') audit(AUDIT_VER_NOT_GRANULAR, app, version); if (version =~ "^1\.3\.1($|[^0-9])") { report = '\n Version source : ' + chomp(banner) + '\n Installed version : ' + version + '\n Fixed version : 1.3.2\n'; security_report_v4(severity:SECURITY_WARNING, port:port, extra:report, sqli:TRUE); exit(0); } else audit(AUDIT_LISTEN_NOT_VULN, app, port, version);
NASL family FreeBSD Local Security Checks NASL id FREEBSD_PKG_CA0841FF125411DEA9640030843D3802.NASL description Secunia 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 seen 2020-06-01 modified 2020-06-02 plugin id 35941 published 2009-03-17 reporter This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/35941 title FreeBSD : proftpd -- multiple sql injection vulnerabilities (ca0841ff-1254-11de-a964-0030843d3802) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-1727.NASL description 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. last seen 2020-06-01 modified 2020-06-02 plugin id 35739 published 2009-02-26 reporter This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/35739 title Debian DSA-1727-1 : proftpd-dfsg - SQL injection vulnerabilites NASL family Mandriva Local Security Checks NASL id MANDRIVA_MDVSA-2009-061.NASL description multiple 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 seen 2020-06-01 modified 2020-06-02 plugin id 37354 published 2009-04-23 reporter This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/37354 title Mandriva Linux Security Advisory : proftpd (MDVSA-2009:061) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-1730.NASL description The 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 seen 2020-06-01 modified 2020-06-02 plugin id 35755 published 2009-03-03 reporter This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/35755 title Debian DSA-1730-1 : proftpd-dfsg - SQL injection vulnerabilites NASL family Gentoo Local Security Checks NASL id GENTOO_GLSA-200903-27.NASL description The 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 seen 2020-06-01 modified 2020-06-02 plugin id 35917 published 2009-03-13 reporter This script is Copyright (C) 2009-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/35917 title GLSA-200903-27 : ProFTPD: Multiple vulnerabilities
References
- http://bugs.proftpd.org/show_bug.cgi?id=3173
- http://secunia.com/advisories/34268
- http://security.gentoo.org/glsa/glsa-200903-27.xml
- http://www.debian.org/security/2009/dsa-1730
- http://www.mandriva.com/security/advisories?name=MDVSA-2009:061
- http://www.openwall.com/lists/oss-security/2009/02/11/4
- http://www.openwall.com/lists/oss-security/2009/02/11/5