Bug 30585 - Apache mod_ssl CRL format string bug
Summary: Apache mod_ssl CRL format string bug
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_ssl (show other bugs)
Version: 2.0.50
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-11 11:42 UTC by Swedish IT Incident Centre
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Swedish IT Incident Centre 2004-08-11 11:42:36 UTC
(Initially reported as SITIC Vulnerability Advisory SA04-001, redefined as bug 
after discussion with ASF httpd security team)

Apache's mod_ssl module suffers from a format string bug when logging
information about CRLs. If an administrator installs a malicious CRL file,
this bug can lead to the execution of arbitrary code.

The function ssl_callback_SSLVerify_CRL() in modules/ssl/ssl_engine_kernel.c
calls ap_log_error() with data from the CRL as the format string instead of
using the data as parameters, leading to a security breach.

This bug was discovered by Ulf Harnhammar for SITIC, Swedish IT 
Incident Centre.

The included patch "issue1.patch" is our attempt at correcting this issue:

--- modules/ssl/ssl_engine_kernel.c	2004-06-07 12:18:37.000000000 +0200
+++ modules/ssl/ssl_engine_kernel.c.ulf	2004-08-02 12:49:18.000000000 +0200
@@ -1372,7 +1372,7 @@
 
             BIO_free(bio);
 
-            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, buff);
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "%s", buff);
         }
 
         /*
Comment 1 Joe Orton 2004-08-11 11:57:17 UTC
Thanks for the report.  Should we credit Ulf Harnhammar for the fix in the
CHANGES file?
Comment 2 Swedish IT Incident Centre 2004-08-12 13:06:24 UTC
Please credit me/us as "Ulf Harnhammar (SITIC)".
Comment 3 Joe Orton 2004-08-23 20:20:33 UTC
Thanks for the patch; this has been committed to HEAD:

http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/ssl/ssl_engine_kernel.c?r1=1.108&r2=1.109