| Summary: | net-www/mod_gzip | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Gentoo Security | Reporter: | Daniel Ahlberg (RETIRED) <aliz> | ||||||||
| Component: | Vulnerabilities | Assignee: | Gentoo Security <security> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | critical | CC: | gerardo, web-apps, woodchip | ||||||||
| Priority: | Highest | ||||||||||
| Version: | unspecified | ||||||||||
| Hardware: | All | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Package list: | Runtime testing required: | --- | |||||||||
| Attachments: |
|
||||||||||
|
Description
Daniel Ahlberg (RETIRED)
2003-06-05 03:39:49 UTC
--- mod_gzip_debug.c 2002-10-01 09:29:49.000000000 +0200
+++ mod_gzip_debug.patch 2003-10-06 17:36:17.000000000 +0200
@@ -94,6 +94,7 @@
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
+#include <stdlib.h>
#include "mod_gzip.h"
#include "mod_gzip_debug.h"
@@ -125,7 +126,7 @@ void mod_gzip_printf( const char *fmt, .
va_start( ap, fmt );
- l = vsprintf( log_line, fmt, ap );
+ l = vsnprintf( log_line, sizeof(log_line), "%s", fmt, ap );
va_end(ap);
@@ -138,6 +139,10 @@ void mod_gzip_printf( const char *fmt, .
void mod_gzip_printf( const char *fmt, ... )
{
+
+ int rndNum;
+ time_t seed = time(NULL);
+
int l;
char *p1;
FILE *log;
@@ -153,10 +158,15 @@ void mod_gzip_printf( const char *fmt, .
long pid = (long) getpid();
#endif
+ srand(seed);
+
+ rndNum = 1+ (int)(1000.0*rand()/(RAND_MAX+1.0));
+ rndNum *= pid;
+
#ifdef WIN32
- sprintf( logname, "c:\\temp\\t%ld.log",(long)pid);
+ sprintf( logname, "c:\\temp\\t%ld.log",rndNum);
#else
- sprintf( logname, "/tmp/t%ld.log",(long)pid);
+ sprintf( logname, "/tmp/t%ld.log",rndNum);
#endif
log = fopen( logname,"a" );
@@ -168,7 +178,7 @@ void mod_gzip_printf( const char *fmt, .
va_start( ap, fmt );
- l = vsprintf(log_line, fmt, ap);
+ l = vsnprintf(log_line, sizeof(log_line, "%s",fmt, ap);
p1=log_line;
while((*p1!=0)&&(*p1!=13)&&(*p1!=10)) p1++;
Created attachment 18854 [details, diff]
patch for this bug
it seems that the the patch that i pasted did not work :P
so i created an attachment
Created attachment 18905 [details, diff]
patch for this bug
Argh... in the previous patch I missed a ) ... this one is ok (I hope!)
Gerardo, Astharot, Nice work Thank you for creating a patch for this and helping us out in #gentoo-security Hopefully woodchip will look it over and commit this patch to portage in/as mod_gzip-1.3.26.1a-r1.ebuild in the next day or two. This bug is assigned to security@g.o and I've not done GLSA's. If it's not handled in the next day or two I'll at least put the patch into CVS and make a new revision. woodchip, Well if you don't mind us touching your mod_gzip package then we can put it in. However it's always preferred if the maintainer fixes his/her package and I'm assuming you might prefer that in this case. We will gladly handle the GLSA aspect of this bug when its time. Patch is in mod_gzip-1.3.26.1a-r1.ebuild; I guess the GLSA can come next. Thanks. Created attachment 19013 [details, diff]
patch
If we are not really defining the DEBUG mode when mod_gzip gets compiled then there really is no reason to send a GLSA. The patch is just good housekeeping :) The bug was fixed on 7 Oct 2003, but -r1 is still masked. It hasn't received any attention since 11 Oct 2003. If I understand correctly, it's not exploitable by default on gentoo. Apache 2 is now the standard on x86 (at least)as well. Closing as FIXED. Reopen if needed. |