SQL injection in ProFTPD mod_sql logging
CVE-2026-42167 is a SQL injection vulnerability in ProFTPD's mod_sql logging pipeline. The is_escaped_text() function incorrectly considers values already escaped when they begin and end with a single quote and contain no internal single quotes. Consequently, sql_resolved_append_text() can omit backend escaping for attacker-controlled FTP values interpolated into SQLNamedQuery statements invoked by SQLLog. Vulnerable logging configurations allow crafted usernames to trigger injection before authentication; other configurations expose post-authentication command inputs. The vulnerable logic was introduced in ProFTPD 1.3.8a and backported to 1.3.7b. Fixes are available in 1.3.9a and 1.3.10rc1. Exploitation can enable database disclosure and modification, authentication bypass, privilege escalation, and configuration-dependent remote code execution.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation permits unauthorized SQL execution with the privileges of ProFTPD's database connection. Attackers can extract authentication data, including plaintext passwords or password hashes, and insert attacker-controlled FTP accounts with chosen credentials and access attributes. Such accounts can bypass authentication restrictions and potentially obtain broad filesystem access through ProFTPD. PostgreSQL supports stacked-query exploitation and remote command execution through COPY TO PROGRAM when the database role has the required privileges; demonstrated execution occurs on the database host as the PostgreSQL operating-system user. SQLite supports stacked queries and backdoor-account insertion. MySQL exploitation is more constrained because the mod_sql integration does not enable multi-statement execution, although single-statement and blind extraction techniques remain possible.
If you can’t patch tonight, do this now.
If upgrading is not immediately possible, disable logging through mod_sql. Monitor FTP and database activity for unexpected account creation and unusual SQL queries. Removing PostgreSQL superuser privileges from the ProFTPD database role limits the documented command-execution path but does not eliminate SQL injection, credential disclosure, or authentication-table manipulation.
Patch, then assume compromise.
Upgrade to ProFTPD 1.3.9a or a later fixed stable release. ProFTPD 1.3.10rc1 also contains the fix. The patch ensures that client-supplied log variables undergo backend SQL escaping before query construction and adds an already_escaped parameter to sql_resolved_append_text() so correctly escaped values do not depend on the flawed heuristic.
6 exploits validated by Mallory's analysis. Hidden: 1 not yet analyzed, such as Exploit-DB entries.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
40 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.