Bug 64515 (CVE-2004-1180) - VUL-0: CVE-2004-1180: rwhod buffer overflow
Summary: VUL-0: CVE-2004-1180: rwhod buffer overflow
Status: RESOLVED FIXED
Alias: CVE-2004-1180
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: All Linux
: P3 - Medium : Major
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL:
Whiteboard: CVE-2004-1180: CVSS v2 Base Score: 5....
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-27 22:33 UTC by Marcus Meissner
Modified: 2021-10-19 14:01 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Meissner 2004-12-27 22:33:01 UTC
---------- Forwarded message ----------                                                                                  
From: Vlad902 <vlad902@gmail.com>                                                                                        
Date: Thu, 23 Dec 2004 19:09:39 -0800                                                                                    
Subject: netkit-rwhod DoS vulnerability                                                                                  
To: netbug@ftp.uk.linux.org                                                                                              
                                                                                                                         
I've found that a DoS vulnerability exists in the netkit-rwhod                                                           
package. rwhod starts two processes, one to listen for connections and                                                   
another to broadcast messages. It is possible to remotely crash the                                                      
listener; it is not possible to exploit this vulnerability to execute                                                    
arbitary code. This vulnerability only occurs on little endian                                                           
computers because rwhod trusts external input. The anomaly exists in                                                     
the following code (rwhod.c):                                                                                            
                                                                                                                         
                cc = recvfrom(sk, (char *)&wd, sizeof(struct whod), 0,                                                   
                              (struct sockaddr *)&from, &len);                                                           
                if (cc <= 0) {                                                                                           
                        if (cc < 0 && errno != EINTR)                                                                    
                                syslog(LOG_WARNING, "recv: %m");           
                                                          continue;                                                                                        
                }                                                                                                        
                                                                                                                         
... Some checks here ...                                                                                                 
                                                                                                                         
#if ENDIAN != BIG_ENDIAN                                                                                                 
                {                                                                                                        
                        int i, n = (cc - WHDRSIZE)/sizeof(struct whoent);                                                
                        struct whoent *we;                                                                               
                                                                                                                         
                        /* undo header byte swapping before writing to file */                                           
                        wd.wd_sendtime = ntohl(wd.wd_sendtime);                                                          
                        for (i = 0; i < 3; i++)                                                                          
                                wd.wd_loadav[i] = ntohl(wd.wd_loadav[i]);                                                
                        wd.wd_boottime = ntohl(wd.wd_boottime);                                                          
                        we = wd.wd_we;                                                                                   
                        for (i = 0; i < n; i++) {                                                                        
                                we->we_idle = ntohl(we->we_idle);                                                        
                                we->we_utmp.out_time =                                                                   
                                    ntohl(we->we_utmp.out_time);                                                         
                                we++;                                                                                    
                        }                                                                                                
                }                                                                                                        
#endif                                                                                                                   
                                                                                                                         
rwhod trusts that the other host sent a packet that is at least of                                                       
size WHDRSIZE, otherwise the integer will roll over to a negative                                                        
number, then when the division occurs it will become a very large                                                        
positive integer causing the second for loop to loop until it reaches                                                    
the end of the stack. When it reaches the end of the stack it will                                                       
fault and cause an effective DoS on the listener. A simple "exploit"                                                     
for this vulnerability would be to send a valid packet of size                                                           
WHDRSIZE-1. This would cause the receiver to not function any longer.                                                    
A simple fix for this vulnerability would be to add a check on the                                                       
'cc' variable directly after the recvfrom() call (rwhod.c:253).                                                          
                                                                                                                         
-vlad902                                                                                                                 
_______________________________________________                                                                          
Vendor Security mailing list                                                                                             
Vendor Security@lst.de                                                                                                   
https://www.lst.de/cgi-bin/mailman/listinfo/vendor-sec
Comment 1 Marcus Meissner 2004-12-27 22:33:01 UTC
<!-- SBZ_reproduce  -->
n/a
Comment 2 Marcus Meissner 2004-12-27 22:35:28 UTC
the same code is in bsd-rwho which we use for 8.1, sles8 and 8.2. 
 
it was dropped for 9.0. 
Comment 3 Marcus Meissner 2004-12-30 19:15:15 UTC
CAN-2004-1180
Comment 4 Mads Martin Joergensen 2004-12-30 19:19:08 UTC
It's not in SLES8, so submitted for 8.1 and 8.2
Comment 5 Marcus Meissner 2005-01-10 17:24:55 UTC
released packages. 
Comment 6 Thomas Biege 2009-10-13 20:09:24 UTC
CVE-2004-1180: CVSS v2 Base Score: 5.0 (AV:N/AC:L/Au:N/C:N/I:N/A:P)