BSD ftpd Single Byte Buffer Overflow Vulnerability

BID:2124

Info

BSD ftpd Single Byte Buffer Overflow Vulnerability

Bugtraq ID: 2124
Class: Boundary Condition Error
CVE:
Remote: Yes
Local: No
Published: Dec 18 2000 12:00AM
Updated: Dec 18 2000 12:00AM
Credit: This vulnerability was discovered by Scrippie <[email protected]>.
Vulnerable: OpenBSD OpenBSD 2.8
OpenBSD OpenBSD 2.7
OpenBSD OpenBSD 2.6
OpenBSD OpenBSD 2.5
OpenBSD OpenBSD 2.4
NetBSD NetBSD 1.5
NetBSD NetBSD 1.4.2
NetBSD NetBSD 1.4.1
NetBSD NetBSD 1.4
David Madore ftpd-BSD 0.2.3
- Caldera OpenLinux 2.4
- Caldera OpenLinux 2.3
- Caldera OpenLinux 2.2
- Debian Linux 2.3
- Debian Linux 2.2
- Debian Linux 2.1
- Debian Linux 2.0
- Mandriva Linux Mandrake 7.2
- Mandriva Linux Mandrake 7.1
- Mandriva Linux Mandrake 7.0
- Mandriva Linux Mandrake 6.1
- Mandriva Linux Mandrake 6.0
- Redhat Linux 7.0
- Redhat Linux 6.0 x
- Redhat Linux 5.0
- Slackware Linux 7.1
- Slackware Linux 7.0
- Slackware Linux 4.0
David A. Holland linux-ftpd 0.17
+ Progeny Debian 1.0
BSD ftpd 0.3.2
+ Progeny Debian 1.0
Not Vulnerable: FreeBSD FreeBSD 4.2
FreeBSD FreeBSD 4.1.1
FreeBSD FreeBSD 4.1
FreeBSD FreeBSD 4.0
FreeBSD FreeBSD 3.5
FreeBSD FreeBSD 3.4
FreeBSD FreeBSD 3.3
FreeBSD FreeBSD 3.2
David Madore ftpd-BSD 0.2.3 -4
- Caldera OpenLinux 2.4
- Caldera OpenLinux 2.3
- Caldera OpenLinux 2.2
- Debian Linux 2.3
- Debian Linux 2.2
- Debian Linux 2.1
- Debian Linux 2.0
- Mandriva Linux Mandrake 7.2
- Mandriva Linux Mandrake 7.1
- Mandriva Linux Mandrake 7.0
- Mandriva Linux Mandrake 6.1
- Mandriva Linux Mandrake 6.0
- Redhat Linux 7.0
- Redhat Linux 6.0 x
- SuSE Linux 7.0
- SuSE Linux 6.0
- SuSE Linux 5.0
- SuSE Linux 4.4.1
- SuSE Linux 4.4
- SuSE Linux 4.3
- SuSE Linux 4.2

Discussion

BSD ftpd Single Byte Buffer Overflow Vulnerability

The ftp daemon derived from 4.x BSD source contains a serious vulnerability that may compromise root access.

There exists a one byte overflow in the replydirname() function. The overflow condition is due to an off-by-one bug that allows an attacker to write a null byte beyond the boundaries of a local buffer and over the lowest byte of the saved base pointer.

As a result, the numerical value of the pointer decreases (and it thus points to a higher location (or lower address) on the stack than it should) and when the replydirname() function returns, the modified saved base pointer is stored in the base pointer register. When the calling function returns, the return address is read from an offset of where the base pointer points to. With the last byte of the base pointer zero, this will be a location other than where it should be.

If this region of the stack is under the control of the attacker, such as the local variable which contained the extra byte in the first place, an arbitrary address can be placed there that will be used as the saved return address by the function.

This is the case in ftpd. It is possible for an attacker to force the ftp daemon to look in user-supplied data for a return address and then execute instructions at the location as root.

This vulnerability can be exploited on systems supporting anonymous ftp if a writeable directory exists (such as an "incoming" directory). This is rarely in place by default.

It should noted that OpenBSD ships with ftp disabled, though it is an extremely commonly used service.

Exploit / POC

BSD ftpd Single Byte Buffer Overflow Vulnerability

The following exploit is available:

Solution / Fix

BSD ftpd Single Byte Buffer Overflow Vulnerability

Solution:
OpenBSD has released a patch for this vulnerability. NetBSD has released patches for versions 1.4.3 and 1.5. It is recommended that users with NetBSD 1.4.2 or earlier upgrade and then apply one of the patches.

Progeny has released patched upgrades for the vulnerable ftp server packages in their distribution of Debian Linux.


David A. Holland linux-ftpd 0.17

David Madore ftpd-BSD 0.2.3

BSD ftpd 0.3.2

NetBSD NetBSD 1.5

OpenBSD OpenBSD 2.8
© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report