Bug 8159 - FTP client handles EOF on input poorly
Summary: FTP client handles EOF on input poorly
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: ftp
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-01-04 07:29 UTC by Scott Gifford
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-02-03 20:08:58 UTC
Embargoed:


Attachments (Terms of Use)

Description Scott Gifford 2000-01-04 07:29:49 UTC
If I FTP in to one of our servers, and hit CTRL-D when prompted for my
login name, the standard FTP client with RedHat 6.0 sends gibberish to the
server.  For example:

Connected to darren.tir.com.
220 ProFTPD 1.2.0pre9 Server (www.tir.com) [darren.tir.com]
Name (darren.tir.com:sgifford): 331 Password required for |}y}0Xo@@$@~.
Password:
530 Login incorrect.
Login failed.
ftp> 221 Goodbye.
[sgifford@sgifford sgifford]$

is what I see on my client when I hit CTRL-D after the Name (...):prompt.

Strangely, if I hit [ENTER] when further prompted for a password, it sends
the string "xterm" as my password.  This does not depend on the value of my
TERM environment variable, and I don't really know where it is coming
from.

It looks like it's just not doing proper input checking.  While no security
consequences are obvious from this, it's possible that the FTP client could
reveal sensitive information stored in memory to the FTP server, as the
client is most likely behaving semi-randomly in this circumstance.

I verified it is not the server with a packet dump:

darren{ROOT}/var/home/sgifford $ snoop -x 0 -s 8192 sgifford.tir.com port
21
Using device /dev/hme (promiscuous mode)
sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4500    .. .vJ.....B..E.
          16: 003c 632a 4000 3f06 26e4 d828 8116 d828    .<c*@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f32 0000 0000 a002    .F....*.O2......
          48: 7d78 b3a2 0000 0204 05b4 0402 080a 15d5    }x..............
          64: c764 0000 0000 0103 0300                   .d........

darren.tir.com -> sgifford.tir.com FTP R port=3549

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 003c 3505 4000 ff06 9508 d828 8046 d828    .<5.@......(.F.(
          32: 8116 0015 0ddd e2bb 1de6 2ae0 4f33 a012    ..........*.O3..
          48: 2798 b64a 0000 0101 080a 036c 521a 15d5    '..J.......lR...
          64: c764 0103 0300 0204 05b4                   .d........

sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4500    .. .vJ.....B..E.
          16: 0034 632b 4000 3f06 26eb d828 8116 d828    .4c+@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f33 e2bb 1de7 8010    .F....*.O3......
          48: 7d78 8c2e 0000 0101 080a 15d5 c764 036c    }x...........d.l
          64: 521a                                       R.

darren.tir.com -> sgifford.tir.com FTP R port=3549 220 ProFTPD 1.2.0pre

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 0071 3506 4000 ff06 94d2 d828 8046 d828    .q5.@......(.F.(
          32: 8116 0015 0ddd e2bb 1de7 2ae0 4f33 8018    ..........*.O3..
          48: 2798 fcfd 0000 0101 080a 036c 5269 15d5    '..........lRi..
          64: c764 3232 3020 5072 6f46 5450 4420 312e    .d220 ProFTPD 1.
          80: 322e 3070 7265 3920 5365 7276 6572 2028    2.0pre9 Server (
          96: 7777 772e 7469 722e 636f 6d29 205b 6461    www.tir.com) [da
         112: 7272 656e 2e74 6972 2e63 6f6d 5d0d 0a   rren.tir.com]..

sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 0034 632d 4000 3f06 26d9 d828 8116 d828    .4c-@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f33 e2bb 1e24 8010    .F....*.O3...$..
          48: 7d3b 8b8f 0000 0101 080a 15d5 c7b4 036c    };.............l
          64: 5269                                       Ri

sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 004e 632f 4000 3f06 26bd d828 8116 d828    .Nc/@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f33 e2bb 1e24 8018    .F....*.O3...$..
          48: 7d78 62d6 0000 0101 080a 15d5 c81c 036c    }xb............l
          64: 5269 5553 4552 20fc fdff bff9 fdff bf30    RiUSER ........0
          80: 5810 4040 2406 08c0 1f05 0d0a              X.@@$.......

darren.tir.com -> sgifford.tir.com FTP R port=3549

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 0034 3507 4000 ff06 950e d828 8046 d828    .45.@......(.F.(
          32: 8116 0015 0ddd e2bb 1e24 2ae0 4f4d 8010    .........$*.OM..
          48: 2798 e046 0000 0101 080a 036c 52d3 15d5    '..F.......lR...
          64: c81c                                       ..

darren.tir.com -> sgifford.tir.com FTP R port=3549 331 Password require

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 0060 3508 4000 ff06 94e1 d828 8046 d828    .`5.@......(.F.(
          32: 8116 0015 0ddd e2bb 1e24 2ae0 4f4d 8018    .........$*.OM..
          48: 2798 d37b 0000 0101 080a 036c 52f3 15d5    '..{.......lR...
          64: c81c 3333 3120 5061 7373 776f 7264 2072    ..331 Password r
          80: 6571 7569 7265 6420 666f 7220 fcfd f9fd    equired for ....
          96: 3058 1040 4024 0608 c01f 052e 0d0a         0X.@@$........

sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 0034 6331 4000 3f06 26d5 d828 8116 d828    .4c1@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f4d e2bb 1e50 8010    .F....*.OM...P..
          48: 7d78 89f6 0000 0101 080a 15d5 c840 036c    }x.v.........@.l
          64: 52f3                                       R.

sgifford.tir.com -> darren.tir.com FTP C port=3549 PASS xterm\r\n

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 0040 6334 4000 3f06 26c6 d828 8116 d828    .@c4@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f4d e2bb 1e50 8018    .F....*.OM...P..
          48: 7d78 d146 0000 0101 080a 15d5 c8f2 036c    }x.F...........l
          64: 52f3 5041 5353 2078 7465 726d 0d0a         R.PASS xterm..

darren.tir.com -> sgifford.tir.com FTP R port=3549

    0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 0034 3509 4000 ff06 950c d828 8046 d828    .45.@......(.F.(
          32: 8116 0015 0ddd e2bb 1e50 2ae0 4f59 8010    .........P*.OY..
          48: 2798 de5e 0000 0101 080a 036c 53ad 15d5    '..^.......lS...
          64: c8f2                                       ..

darren.tir.com -> sgifford.tir.com FTP R port=3549 530 Login incorrect.

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 004a 350a 4000 ff06 94f5 d828 8046 d828    .J5.@....u.(.F.(
          32: 8116 0015 0ddd e2bb 1e50 2ae0 4f59 8018    .........P*.OY..
          48: 2798 30cc 0000 0101 080a 036c 53e9 15d5    '.0........lS...
          64: c8f2 3533 3020 4c6f 6769 6e20 696e 636f    ..530 Login inco
          80: 7272 6563 742e 0d0a                        rrect...

sgifford.tir.com -> darren.tir.com FTP C port=3549 SYST\r\n

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 003a 6337 4000 3f06 26c9 d828 8116 d828    .:c7@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f59 e2bb 1e66 8018    .F....*.OY...f..
          48: 7d78 d425 0000 0101 080a 15d5 c933 036c    }x.%.........3.l
          64: 53e9 5359 5354 0d0a                        S.SYST..

darren.tir.com -> sgifford.tir.com FTP R port=3549 530 Please login wit

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 005a 350b 4000 ff06 94e4 d828 8046 d828    .Z5.@......(.F.(
          32: 8116 0015 0ddd e2bb 1e66 2ae0 4f5f 8018    .........f*.O_..
          48: 2798 787b 0000 0101 080a 036c 53ea 15d5    '.x{.......lS...
          64: c933 3533 3020 506c 6561 7365 206c 6f67    .3530 Please log
          80: 696e 2077 6974 6820 5553 4552 2061 6e64    in with USER and
          96: 2050 4153 532e 0d0a                         PASS...

sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 0034 6339 4000 3f06 26cd d828 8116 d828    .4c9@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f5f e2bb 1e8c 8010    .F....*.O_......
          48: 7d78 87ba 0000 0101 080a 15d5 c937 036c    }x...........7.l
          64: 53ea                                       S.

sgifford.tir.com -> darren.tir.com FTP C port=3549 QUIT\r\n

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 003a 633b 4000 3f06 26c5 d828 8116 d828    .:c;@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f5f e2bb 1e8c 8018    .F....*.O_......
          48: 7d78 dfab 0000 0101 080a 15d5 c984 036c    }x.............l
          64: 53ea 5155 4954 0d0a                        S.QUIT..

darren.tir.com -> sgifford.tir.com FTP R port=3549 221 Goodbye.\r\n

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 0042 350c 4000 ff06 94fb d828 8046 d828    .B5.@......(.F.(
          32: 8116 0015 0ddd e2bb 1e8c 2ae0 4f65 8018    ..........*.Oe..
          48: 2798 ee09 0000 0101 080a 036c 543a 15d5    '..........lT:..
          64: c984 3232 3120 476f 6f64 6279 652e 0d0a    ..221 Goodbye...

darren.tir.com -> sgifford.tir.com FTP R port=3549

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 0034 350d 4000 ff06 9508 d828 8046 d828    .45.@......(.F.(
          32: 8116 0015 0ddd e2bb 1e9a 2ae0 4f65 8011    ..........*.Oe..
          48: 2798 dce8 0000 0101 080a 036c 543a 15d5    '..........lT:..
          64: c984                                       ..

sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 0034 633c 4000 3f06 26ca d828 8116 d828    .4c<@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f65 e2bb 1e9a 8011    .F....*.Oe......
          48: 7d78 8707 0000 0101 080a 15d5 c985 036c    }x.............l
          64: 543a                                       T:

sgifford.tir.com -> darren.tir.com FTP C port=3549

           0: 0800 209a 764a 0000 a2eb 1942 0800 4510    .. .vJ.....B..E.
          16: 0034 633d 4000 3f06 26c9 d828 8116 d828    .4c=@.?.&..(...(
          32: 8046 0ddd 0015 2ae0 4f66 e2bb 1e9b 8010    .F....*.Of......
          48: 7d78 8706 0000 0101 080a 15d5 c985 036c    }x.............l
          64: 543a                                       T:

darren.tir.com -> sgifford.tir.com FTP R port=3549

           0: 00a0 c9e0 3d2d 0800 209a 764a 0800 4500    ....=-.. .vJ..E.
          16: 0034 350e 4000 ff06 9507 d828 8046 d828    .45.@......(.F.(
          32: 8116 0015 0ddd e2bb 1e9b 2ae0 4f66 8010    ..........*.Of..
          48: 2798 dce5 0000 0101 080a 036c 543b 15d5    '..........lT;..
          64: c985                                       ..

Thanks,

------ScottG.

Comment 1 Elliot Lee 2000-02-03 20:08:59 UTC
Works fine here with latest ftp package in rawhide - I will assume that the
problem has been fixed since your report.


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