[Trac-tickets] [The Trac Project] #2901: Apache crashes when used with modpython and LDAP authentication

The Trac Project noreply at edgewall.com
Sun Mar 19 15:55:22 CST 2006


#2901: Apache crashes when used with modpython and LDAP authentication
---------------------+------------------------------------------------------
 Reporter:  eblot    |       Owner:  jonas
     Type:  defect   |      Status:  new  
 Priority:  normal   |   Milestone:       
Component:  general  |     Version:  devel
 Severity:  major    |    Keywords:       
---------------------+------------------------------------------------------
 Since the introduction of the WSGI support in [2957], Apache server
 crashes when the following environment is used:
   * modpython (3.1.x, 3.2.x series)
   * python (2.3.x, 2.4.x)
   * LDAP authentication support (mod_auth_ldap, unrelated to the [http
 ://trac-hacks.org/wiki/LdapPlugin LdapPlugin])

 The crash of the Apache thread occurs when the user authenticates, i.e.
 when she submits her password at the .../login URL.

 The root cause is the LDAP authentication module:[[BR]]
 It defines an extra environment variable `AUTHENTICATE_UID`, which may
 takes an invalid (null ?) value.

 This value is retrieved in `modpython/apache.py:build_cgi_env(req)` and
 added to the CGI environment variable.[[BR]]
 This dictionnary is then duplicated in
 `trac/web/modpython_frontend.py:ModPythonGateway::__init__` using
 `environ.duplicate()` call.

 When the `duplicate()` method attempts to duplicate the value of the
 `AUTHENTICATE_UID` key, it produces an invalid call which ends up in
 calling the libc `strlen()` function with an invalid parameter, and
 eventually crashes the current Apache thread.

 I attach a patch against [3025] which discards this invalid key, but I
 guess the real fix up should be done in the modpython Apache module.

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/2901>
The Trac Project <http://trac.edgewall.com/>


More information about the Trac-Tickets mailing list