| Titolo | ProFTPD 1.3.7 through 1.3.9 and 1.3.10rcX Incorrect Behavior Order |
|---|
| Descrizione | ProFTPD before 1.3.10 incorrectly commits authenticated session state in the passwordless-authentication path of mod_auth (modules/mod_auth.c, auth_user()). When passwordless authentication is enabled via mod_tls (AllowDotLogin or TLSUserName, i.e. client-certificate authentication), a client that has been banned by mod_ban or denied by mod_wrap can obtain a session that runs with the daemon’s root privileges and outside any chroot, allowing arbitrary file read and write and code execution as root. The control the administrator configured to contain the client is what enables the escalation.
AFFECTED
Affected: all releases before 1.3.10, including the 1.3.10rc series. Source-confirmed in every release tag from 1.3.5a (2015) through 1.3.10rc5; the vulnerable code is present in the project’s 2013 repository import, predating recorded history. Branches 1.3.8 and earlier are end-of-life. Fixed in 1.3.10 (commit 04f1ac85) and the 1.3.9 stable branch (backport 684bb161). The flaw is only reachable when mod_tls AllowDotLogin or TLSUserName is configured and mod_ban or mod_wrap is active.
TECHNICAL DETAILS
On a passwordless session, mod_auth’s USER handler dispatches a synthetic PASS command internally to complete the login. In auth_user(), the server-config record “authenticated” is set (and authenticated_without_pass is set to TRUE) BEFORE pr_cmd_dispatch() of that synthetic command, and the handler returns PR_HANDLED regardless of the dispatch result.
mod_ban (ban_pre_pass) and mod_wrap (wrap_handle_request) register PRE_CMD(PASS) handlers that return 530 for a banned or denied client without closing the connection. When a PRE_CMD handler returns an error, the core command loop skips the CMD phase, so auth_pass() and setup_env() never run. As a result, the privilege drop (setuid/setgid to the target user) and the chroot (DefaultRoot / Anonymous) do not occur. The “authenticated” record is not reset on this path, and the per-command authorization gate (auth_cmd_chk_cb) checks only that record, not session.user. The session is therefore treated as authenticated while retaining the daemon’s root identity and no chroot. Because session.user is NULL on this path, the certificate’s mapped identity does not need to correspond to the attacker’s own account, enabling cross-tenant impersonation on shared-hosting FTPS.
IMPACT
A banned or denied client-certificate user obtains a root, un-chrooted session: arbitrary file read (for example /etc/shadow or other tenants’ data), arbitrary file write (for example /root/.ssh/authorized_keys or /etc/cron.d/*), and code execution as root. This is full host compromise from a party the administrator explicitly tried to lock out.
REPRODUCTION
With ProFTPD 1.3.10rc6, TLSUserName CommonName (or AllowDotLogin), User root, DefaultRoot ~ftptest, and BanOnEvent LoginRate to induce a ban: AUTH TLS with a CA-trusted client certificate, then USER ftptest with no PASS, returns 232 (passwordless login). Repeated logins trip the ban. In a banned session, USER ftptest returns 530, but PWD returns 257 “” (a real login returns 257 “/”), CWD /root returns 250 (chroot escaped), and STAT /root returns 212 (running as root). Over a PROT P data channel, RETR /etc/shadow returns 226 (root read) and STOR /root/.ssh/authorized_keys returns 226 (root write). STOR /etc/cron.d/<name> with a cron entry yields code execution as root.
MITIGATION
Update to ProFTPD 1.3.10, or apply commit 04f1ac85 (1.3.9 stable branch: 684bb161). The fix commits authentication state only after pr_cmd_dispatch() of the synthetic PASS returns success and session.user is set; otherwise it resets the passwordless-auth state. Where updating is not immediately possible, the chain is broken by removing any one precondition (passwordless certificate auth, or the mod_ban / mod_wrap denier). |
|---|
| Fonte | ⚠️ https://everydaysparkling.com/p/97c96846-1778-4402-8bd2-63246aa98e53/?member_status=free |
|---|
| Utente | Jelle Janssens (UID 81048) |
|---|
| Sottomissione | 09/11/2026 09:15 (24 giorni fa) |
|---|
| Moderazione | 03/12/2026 09:59 (24 days later) |
|---|
| Stato | Accettato |
|---|
| Voce VulDB | 448615 [ProFTPD fino a 1.3.10rc5 modules/mod_auth.c auth_user autenticazione debole] |
|---|
| Punti | 20 |
|---|