]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Unescaped errorlogs are still possible using the compile time switch
authorAndré Malo <nd@apache.org>
Fri, 23 Jan 2004 00:05:57 +0000 (00:05 +0000)
committerAndré Malo <nd@apache.org>
Fri, 23 Jan 2004 00:05:57 +0000 (00:05 +0000)
"-DAP_UNSAFE_ERROR_LOG_UNESCAPED".

Reviewed by:    Stas Bekman, Geoffrey Young

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@102391 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/main/http_log.c

index 7efb5f1769d247e593ffd9630781ded77aa499ef..16f21df307c49ca86905406893cde56c33219bdd 100644 (file)
@@ -25,8 +25,9 @@ Changes with Apache 1.3.30
      [Ben Laurie]
 
   *) SECURITY: CAN-2003-0020 (cve.mitre.org)
-     Escape arbitrary data before writing into the errorlog.  
-     [André Malo]
+     Escape arbitrary data before writing into the errorlog. Unescaped
+     errorlogs are still possible using the compile time switch
+     "-DAP_UNSAFE_ERROR_LOG_UNESCAPED".  [Geoffrey Young, André Malo]
 
   *) '%X' is now accepted as an alias for '%c' in the
      LogFormat directive. This allows you to configure logging
index 9f5eabc35cfd30fdfefe480ebf1a7df6eeb131c0..ccb3f896598e62fe385bee38714b1650235aba91 100644 (file)
@@ -313,7 +313,10 @@ static void log_error_core(const char *file, int line, int level,
                           const server_rec *s, const request_rec *r,
                           const char *fmt, va_list args)
 {
-    char errstr[MAX_STRING_LEN], scratch[MAX_STRING_LEN];
+    char errstr[MAX_STRING_LEN];
+#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
+    char scratch[MAX_STRING_LEN];
+#endif
     size_t len;
     int save_errno = errno;
     FILE *logf;
@@ -445,10 +448,14 @@ static void log_error_core(const char *file, int line, int level,
     }
 #endif
 
+#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
     if (ap_vsnprintf(scratch, sizeof(scratch) - len, fmt, args)) {
         len += ap_escape_errorlog_item(errstr + len, scratch,
                                        sizeof(errstr) - len);
     }
+#else
+    len += ap_vsnprintf(errstr + len, sizeof(errstr) - len, fmt, args);
+#endif
 
     /* NULL if we are logging to syslog */
     if (logf) {