Bug 956344 - htpasswd and httpd basic file auth are not compatible, authentication always fails with password mismatch
Summary: htpasswd and httpd basic file auth are not compatible, authentication always ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Joe Orton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-24 18:22 UTC by Gary Granger
Modified: 2013-06-02 03:03 UTC (History)
5 users (show)

Fixed In Version: httpd-2.4.4-6.fc19
Clone Of:
Environment:
Last Closed: 2013-05-28 01:06:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache Bugzilla 54735 0 None None None Never

Description Gary Granger 2013-04-24 18:22:19 UTC
Description of problem:
htpasswd seems to create password hashes which httpd cannot match.

Version-Release number of selected component (if applicable):
httpd.x86_64 0:2.4.4-2.fc18
httpd-tools.x86_64 0:2.4.4-2.fc18
mod_ssl.x86_64 1:2.4.4-2.fc18

How reproducible:
always

Steps to Reproduce:
1. Configure httpd directory for simple access control:

<Directory "/var/www/html/snoopy">
   Options None
   AllowOverride None
   AuthName "Snoopy Access"
   AuthType Basic
   AuthBasicProvider file
   AuthUserFile /etc/httpd/passwd
   Require valid-user
</Directory>

2. Create the password file: htpasswd -c /etc/httpd/passwd user
3. Try accessing the url http://localhost/snoopy with the user and password from #2
  
Actual results:
The browser (firefox) will ask for authentication for "Snoopy Access", but all attempts to enter the right password will fail.  There will be messages in /var/log/httpd/error_log about "password mismatch".

Expected results:
The browser should be able to display the page after entering the same credentials as created in the passwd file with htpasswd.

Additional info:
This same sequence works if I downgrade to the latest non-testing releases of these packages:
httpd-2.4.3-12.fc18.x86_64
httpd-tools-2.4.3-12.fc18.x86_64
mod_ssl-2.4.3-12.fc18.x86_64

After updating to the newer versions, authentication still works.  However, after modifying or recreating the passwd file with the upgraded htpasswd, authentication no longer works.  That's what suggests to me that the htpasswd algorithm has somehow changed.  I have mostly tested the MD5 hash, but I have tried others like SHA and plain text those did not work either.

Interestingly, a plain text password with earlier versions of htpasswd are actually readable, eg:

shiraz|109|% htpasswd -p -c passwd granger
Warning: storing passwords as plain text might just not work on this platform.
New password: 
Re-type new password: 
Adding password for user granger
shiraz|110|% cat passwd 
granger:test

Whereas the same command and password with the 2.4.3-12 htpasswd produces this:

[root@snoopy httpd]# cat passwd
test:`6G��

Perhaps this is some change in handling text encoding or something?

Comment 1 Ville-Pekka Vainio 2013-04-30 14:32:09 UTC
I added a link to the Apache patch which probably fixes this.

Comment 2 Johan Cwiklinski 2013-05-16 16:52:25 UTC
A bug in htpasswd command has been fixed in apache 2.4.5, see:
https://issues.apache.org/bugzilla/show_bug.cgi?id=54735

This resolves the "password mismatch" issue. Would it be possible to have it applied on the Fedora package? That bug is really annoying.

Comment 3 Fedora Update System 2013-05-17 12:42:04 UTC
httpd-2.4.4-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/httpd-2.4.4-3.fc18

Comment 4 Fedora Update System 2013-05-19 02:38:59 UTC
Package httpd-2.4.4-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing httpd-2.4.4-3.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-8577/httpd-2.4.4-3.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-05-20 09:44:46 UTC
httpd-2.4.4-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/httpd-2.4.4-6.fc19

Comment 6 Fedora Update System 2013-05-28 01:06:13 UTC
httpd-2.4.4-3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2013-06-02 03:03:20 UTC
httpd-2.4.4-6.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.