Bug 737016 - ftp: off-by-one in account command parsing
Summary: ftp: off-by-one in account command parsing
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: ftp
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Jiri Skala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-09 11:15 UTC by Tomas Hoger
Modified: 2014-11-09 22:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-09 13:54:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Tomas Hoger 2011-09-09 11:15:37 UTC
Description of problem:
See: http://www.exploit-db.com/exploits/17806/

Account name as shown there is too long for our ftp, but a name longer than 128 chars should do to reproduce.

The problem is in cmds.c account():

   1840      strncat(buf, *argv, sizeof(buf)-strlen(buf));
   1841      buf[sizeof(buf)-1] = 0;

strncat always writes terminating null, so this should say sizeof(buf)-strlen(buf)-1.  Line 1841 should be redundant.

So this is one byte overflow with '\0', triggered by (trusted) user input, caught by fortify source.


Note You need to log in before you can comment on or make changes to this bug.