Bug 2356 - Remotely exploitable Infostring Crash
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P5 critical
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL: http://aluigi.altervista.org/adv/q3in...
Depends on:
Blocks:
 
Reported: 2005-08-31 22:00 EDT by Thilo Schulz
Modified: 2007-05-21 11:27:36 EDT
0 users

See Also:


Attachments
Patch to fix the bug. (608 bytes, patch)
2005-08-31 22:06 EDT, Thilo Schulz

Description Thilo Schulz 2005-08-31 22:00:57 EDT
Hello, Luigi Auriemma has already reported this about half a year ago, with  
PoC. I got a patch that should take care of this. I set the max challenge size  
to 128 to be on the safe side. It won't be able to make the infostring too  
long, nor will it be too small for some challenge/response games out there, I  
guess. 
    
Thilo server # diff -u sv_main.old.c sv_main.c    
--- sv_main.old.c       2005-09-01 03:27:27.000000000 +0200    
+++ sv_main.c   2005-09-01 03:54:09.000000000 +0200    
@@ -373,6 +373,15 @@    
                return;    
        }    
    
+       /*    
+        * Check whether Cmd_Argv(1) has a sane length. This was not done in    
the original Quake3 version which led    
+        * to the Infostring bug discovered by Luigi Auriemma. See    
http://aluigi.altervista.org/ for the advisory.    
+        */    
+    
+       // A maximum challenge length of 128 should be more than plenty.    
+       if(strlen(Cmd_Argv(1)) > 128)    
+               return;    
+    
        // don't count privateclients    
        count = 0;    
        for ( i = sv_privateClients->integer ; i < sv_maxclients->integer ;    
i++ ) {
Comment 1 Thilo Schulz 2005-08-31 22:06:16 EDT
Created attachment 773 [details]
Patch to fix the bug.

There we go ... cleanly in a file without random linebreaks.
Comment 2 Zachary J. Slater 2005-08-31 22:14:05 EDT
Thanks, CI'd.
Comment 3 Ryan C. Gordon 2007-05-21 11:27:36 EDT
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.

--ryan.