www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Esposito <...@silvertech.net>
Subject general/7352: crypt() function returns null, crashes ap_cpystrn
Date Sat, 03 Mar 2001 15:29:02 GMT

>Number:         7352
>Category:       general
>Synopsis:       crypt() function returns null, crashes ap_cpystrn
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Sat Mar 03 07:30:01 PST 2001
>Originator:     epe@silvertech.net
>Release:        1.3.19
distribution: Slackware 7.1
uname -a: Linux ns1 2.2.18 #1 Mon Jan 29 14:10:43 EST 2001 i686 unknown
gcc -v: gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Apache was compiled from the tarball off of the main apache FTP server.
On my system, the DES addon to glibc-crypt has been removed, which results in crypt() not
supporting DES passwords which are generated with the old-style salts. When called without
$1$ prefixed to the salt, crypt() returns null.  This null is then passed straight to ap_cpystrn(),
which dereferences the null pointer.

This problem crashes both htpasswd and the daemon servicing the request which results in a
.htaccess file being read.

On my system, the following C code generates the following output

#include <unistd.h>
#include <stdio.h>

        printf("%s\n", crypt("password", "D3PtJ1FI"));
        printf("%s\n", crypt("password", "$1$D3PtJ1FI"));

Compile and execute the above code.  I am willing to provide an account with ssh access on
my system, if needed.
Pass the $1$ into crypt(), or add a configure option which would do that.
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message