Bug 105510 - security: ftp/proftpd "CommandBufferSize" Directive Remote Code Execution Vulnerability
Summary: security: ftp/proftpd "CommandBufferSize" Directive Remote Code Execution Vul...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Shaun Amott
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-14 07:00 UTC by Oleksii Samorukov
Modified: 2006-11-29 14:10 UTC (History)
0 users

See Also:


Attachments
file.diff (2.17 KB, patch)
2006-11-14 07:00 UTC, Oleksii Samorukov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksii Samorukov freebsd_committer freebsd_triage 2006-11-14 07:00:04 UTC

A vulnerability has been identified in ProFTPD, which could be exploited by attackers to cause a denial of service or execute arbitrary commands. This flaw is due to a buffer overflow error in the "main.c" file where the "cmd_buf_size" size of the buffer used to handle FTP commands sent by clients is not properly set to the size configured via the "CommandBufferSize" directive, which could be exploited by attackers to compromise a vulnerable server via a specially crafted FTP command.

I backported fix from http://proftp.cvs.sourceforge.net/proftp/proftpd/src/main.c?r1=1.292&r2=1.293&sortby=date

How-To-Repeat: 

see http://www.frsirt.com/english/advisories/2006/4451
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-11-14 07:00:15 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Beech Rintoul 2006-11-14 19:30:07 UTC
I approve the patch.

Beech Rintoul (Maintainer)
-- 
---------------------------------------------------------------------------------------
Beech Rintoul - Sys. Administrator - beech@alaskaparadise.com
/"\   ASCII Ribbon Campaign  | Alaska Paradise Travel
\ / - NO HTML/RTF in e-mail  | 201 East 9Th Avenue Ste.310
 X  - NO Word docs in e-mail | Anchorage, AK 99501
/ \  - Please visit Alaska Paradise - http://www.alaskaparadise.com
---------------------------------------------------------------------------------------
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2006-11-14 20:46:28 UTC
State Changed
From-To: feedback->open

maintainer approved
Comment 4 Shaun Amott freebsd_committer freebsd_triage 2006-11-14 23:12:03 UTC
Responsible Changed
From-To: freebsd-ports-bugs->shaun

Grab.
Comment 5 dfilter service freebsd_committer freebsd_triage 2006-11-15 00:06:05 UTC
shaun       2006-11-15 00:05:59 UTC

  FreeBSD ports repository

  Modified files:
    ftp/proftpd          Makefile 
  Added files:
    ftp/proftpd/files    patch-main.c 
  Log:
  Add a patch from CVS to fix a security vulnerability.
  
  PR:             ports/105510
  Submitted by:   Alex Samorukov <samm@os2.kiev.ua>
  Approved by:    Beech Rintoul <beech@alaskaparadise.com> (maintainer)
  Security:       VuXML cca97f5f-7435-11db-91de-0008743bf21a
  
  Revision  Changes    Path
  1.91      +1 -1      ports/ftp/proftpd/Makefile
  1.1       +46 -0     ports/ftp/proftpd/files/patch-main.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Shaun Amott freebsd_committer freebsd_triage 2006-11-15 00:06:16 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 7 Alessandro Dellavedova 2006-11-15 15:38:39 UTC
Dear Sirs,

we just recompiled the port on two different boxes (FreeBSD 6.1 and  
FreeBSD 5.4).

The result are:

- With the main.c patch applied, if you connect to the FTP server and  
then enter a user name, press RETURN, then crash.

(15:14:17 default@<~>) # ftp pan
Connected to pan.xxx.it
220 I am PAN, wtf did you say you are ?
Name (pan:default): <valid_user>
421 Service not available, remote server has closed connection.
ftp: Login failed.
ftp> quit

In the /var/log/messages:

Nov 15 14:27:42 pan kernel: pid 64242 (proftpd), uid 65534: exited on  
signal 11

If you remove the patch and recompile the port, proftpd works fine.

Best regards,

Alessandro Dellavedova
Comment 8 Alessandro Dellavedova 2006-11-15 15:58:45 UTC
Ok, spotted the problem, if you use that patch then the:

CommandBufferSize

keyword MUST be present in the proftpd configuration file, otherwise  
the daemon crashes as soon as you try to attach to it.
Comment 9 Shaun Amott freebsd_committer freebsd_triage 2006-11-15 19:27:47 UTC
On Wed, Nov 15, 2006 at 04:00:14PM +0000, Alessandro Dellavedova wrote:
> 
>  Ok, spotted the problem, if you use that patch then the:
>  
>  CommandBufferSize
>  
>  keyword MUST be present in the proftpd configuration file, otherwise  
>  the daemon crashes as soon as you try to attach to it.
> 


I've fixed the port now. Thanks for your report.

-- 
Shaun Amott // PGP: 0x6B387A9A
"A foolish consistency is the hobgoblin
of little minds." - Ralph Waldo Emerson
Comment 10 Matus UHLAR - fantomas 2006-11-29 14:03:01 UTC
Hello,

the patch causes proftpd comply when CommandBufferSize is not used. I think
that next change
(http://proftp.cvs.sourceforge.net/proftp/proftpd/src/main.c?r1=1.293&r2=1.294&sortby=date)
fixes this behaviour.
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
"One World. One Web. One Program." - Microsoft promotional advertisement
"Ein Volk, ein Reich, ein Fuhrer!" - Adolf Hitler