Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76834 - net-www/apache: htdigest buffer overflow
Summary: net-www/apache: htdigest buffer overflow
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-05 16:53 UTC by Luke Macken (RETIRED)
Modified: 2005-02-02 02:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Macken (RETIRED) gentoo-dev 2005-01-05 16:53:19 UTC
Apache "htdigest" Buffer Overflow
------------------------------------------------------------------------


SUMMARY

htdigest is "a utility included with Apache Web Server, useful to create
and update usernames, realms and passwords for digest authentication of
HTTP users".

Due improper testing of bounds by the htdigest program, an attacker that
is able to invoke the program can cause it to execute arbitrary code.

DETAILS

The htdigest program does not perform any bounds checking when it copies
the "user" and "realm" supplied as arguments to htdigest into local
buffers. Therefore by sending an overly long buffer, an attacker can
trigger a buffer overflow in the program. This overflow can be exploited
to cause htdigest to execute arbitrary code. This issue can become serious
if htdigest is called from a CGI script available to remote users.

Proof of Concept:
# pwd
/root/httpd-2.0.52/support
# ./htdigest -c file `perl -e 'print "A" x 9999'` user
Adding password for user in realm AAAAAAAAAAAAAAAAA.............AAAAA
New password:
Re-type new password:
Segmentation fault


ADDITIONAL INFORMATION

The information has been provided by  <mailto:luca.ercoli@inwind.it> Luca
Ercoli.
Comment 1 Luke Macken (RETIRED) gentoo-dev 2005-01-05 16:54:15 UTC
I'm not sure the severity on this one, but the htdigest2 utility is vulnerable as well.

Apache herd, please verify/advise.
Comment 2 Paul Querna 2005-01-05 17:08:32 UTC
This should be filed upstream.  Severity is pretty low, unless people write PHP/CGI scripts that make htdigest available to external users.  However, these scripts should likely do their own input validation.