]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Don't risk segfault in authz if r->user is not set
authorNick Kew <niq@apache.org>
Tue, 20 Jul 2010 01:34:39 +0000 (01:34 +0000)
committerNick Kew <niq@apache.org>
Tue, 20 Jul 2010 01:34:39 +0000 (01:34 +0000)
PR 42995

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965709 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/request.c

diff --git a/CHANGES b/CHANGES
index 6b82bb6c40011c3712e58a218e99ac1f06259975..51e520f96993f2f0acf2473b5e65d477e35b8bf0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -32,6 +32,10 @@ Changes with Apache 2.3.7
   *) CGI vars: allow PATH to be set by SetEnv, consistent with LD_LIBRARY_PATH
      PR 43906 [Nick Kew]
 
+  *) Core: Extra robustness: don't try authz and segfault if authn
+     fails to set r->user.  Log bug and return 500 instead.
+     PR 42995 [Nick Kew]
+
 Changes with Apache 2.3.6
 
   *) SECURITY: CVE-2009-3555 (cve.mitre.org)
index bc261829ab827d324aa6d2968fce26f214758b5b..7ce9b80cd4919e2aff4e25470ade4f23a1ca2f53 100644 (file)
@@ -225,6 +225,14 @@ AP_DECLARE(int) ap_process_request_internal(request_rec *r)
                 if ((access_status = ap_run_check_user_id(r)) != OK) {
                     return decl_die(access_status, "check user", r);
                 }
+                if (r->user == NULL) {
+                    /* don't let buggy authn module crash us in authz */
+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                                  "Buggy authn provider failed to set user for %s",
+                                  r->uri);
+                    access_status = HTTP_INTERNAL_SERVER_ERROR;
+                    return decl_die(access_status, "check user", r);
+                }
                 if ((access_status = ap_run_auth_checker(r)) != OK) {
                     return decl_die(access_status, "check authorization", r);
                 }