CVE-2023-45198

7.5 HIGH

📋 TL;DR

This vulnerability in ftpd allows unauthenticated attackers to obtain information about the host filesystem before authentication using MLSD or MLST commands. It affects NetBSD-ftpd before 20230930 and tnftpd before 20231001. The information leak could reveal directory structures and file metadata.

💻 Affected Systems

Products:
  • NetBSD-ftpd
  • tnftpd (portable NetBSD ftpd)
Versions: NetBSD-ftpd before 20230930, tnftpd before 20231001
Operating Systems: NetBSD, Other systems using tnftpd
Default Config Vulnerable: ⚠️ Yes
Notes: Affects both NetBSD's built-in ftpd and the portable tnftpd version used on other systems.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers map the entire filesystem structure, identify sensitive directories, and use this reconnaissance for subsequent attacks like privilege escalation or data exfiltration.

🟠

Likely Case

Attackers discover directory layouts, user home directories, configuration file locations, and other system information that aids in targeted attacks.

🟢

If Mitigated

Limited exposure of non-sensitive directory structures with no authentication bypass or data access.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires only sending standard FTP commands (MLSD/MLST) before authentication.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: NetBSD-ftpd 20230930, tnftpd 20231001

Vendor Advisory: https://mail-index.netbsd.org/source-changes/2023/09/22/msg147669.html

Restart Required: Yes

Instructions:

1. Update NetBSD system to include ftpd fixes after 20230930. 2. For tnftpd, upgrade to version 20231001 or later. 3. Restart ftpd service.

🔧 Temporary Workarounds

Disable MLSD/MLST commands

all

Configure ftpd to reject MLSD and MLST commands before authentication

Check ftpd configuration for command restrictions

Use firewall rules

linux

Restrict FTP access to trusted networks only

iptables -A INPUT -p tcp --dport 21 -s TRUSTED_NET -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j DROP

🧯 If You Can't Patch

  • Implement network segmentation to isolate FTP servers
  • Monitor FTP logs for MLSD/MLST commands from unauthenticated users

🔍 How to Verify

Check if Vulnerable:

Connect to FTP server anonymously and issue MLSD or MLST command before authentication

Check Version:

ftpd -v or check package version: pkg_info | grep ftpd

Verify Fix Applied:

After patching, attempt MLSD/MLST before authentication should be rejected

📡 Detection & Monitoring

Log Indicators:

  • MLSD or MLST commands from unauthenticated users
  • FTP session without successful USER/PASS commands

Network Indicators:

  • FTP traffic with MLSD/MLST commands before authentication packets

SIEM Query:

source="ftp.log" AND (command="MLSD" OR command="MLST") AND NOT auth_success="true"

🔗 References

📤 Share & Export