|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-12-06 19:34 UTC] henrich at msu dot edu
PHP_AUTH_PW is being improperly set when external authentication is active on Apache. I have a directory structure that is protected via Apache authentication, according to the PHP documentation the PHP_AUTH_PW should not be available when external authentication is in use. This is necessary for security concerns when you cannot trust the php applications. In any case, w/ php the AUTH_PW is being set at all times. Please fix, thanks! PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
The following patch solves this bug by not exporting the PHP_AUTH_* variables when safe_mode is set. ===8<==================================================== --- php-4.1.2/main/main.c.orig-securevars Mon Dec 17 22:19:51 2001 +++ php-4.1.2/main/main.c Mon Mar 11 07:34:40 2002 @@ -1031,10 +1031,10 @@ } /* PHP Authentication support */ - if (SG(request_info).auth_user) { + if (!PG(safe_mode) && SG(request_info).auth_user) { php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr TSRMLS_CC); } - if (SG(request_info).auth_password) { + if (!PG(safe_mode) && SG(request_info).auth_password) { php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr TSRMLS_CC); } }The following patch solves this bug by not exporting the PHP_AUTH_* variables if safe_mode is set. ===8<==================================================== --- php-4.1.2/main/main.c.orig-securevars Mon Dec 17 22:19:51 2001 +++ php-4.1.2/main/main.c Mon Mar 11 07:34:40 2002 @@ -1031,10 +1031,10 @@ } /* PHP Authentication support */ - if (SG(request_info).auth_user) { + if (!PG(safe_mode) && SG(request_info).auth_user) { php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr TSRMLS_CC); } - if (SG(request_info).auth_password) { + if (!PG(safe_mode) && SG(request_info).auth_password) { php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr TSRMLS_CC); } }