|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-06-13 14:21 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Type: Security
+Type: Bug
-Assigned To:
+Assigned To: cmb
[2018-06-13 14:21 UTC] cmb@php.net
[2018-06-13 14:28 UTC] clement dot oudot at worteks dot com
[2018-06-13 14:34 UTC] nikic@php.net
[2018-06-13 15:30 UTC] clement dot oudot at worteks dot com
[2018-06-13 15:46 UTC] cmb@php.net
[2018-06-13 15:55 UTC] clement dot oudot at worteks dot com
[2018-06-13 16:35 UTC] cmb@php.net
[2018-06-13 17:12 UTC] clement dot oudot at worteks dot com
[2018-06-13 20:35 UTC] cmb@php.net
-Summary: Bad call to ldap_bind not setting error in
ldap_errno
+Summary: ldap_bind should return NULL when called with
wrong types
-Status: Not a bug
+Status: Open
-Type: Bug
+Type: Feature/Change Request
-Assigned To: cmb
+Assigned To:
[2018-06-13 20:35 UTC] cmb@php.net
[2018-11-01 08:04 UTC] heiglandreas@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: heiglandreas
[2018-11-01 08:04 UTC] heiglandreas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
Description: ------------ When using an array as password when calling ldap_bind, we have a warning but ldap_errno is not reset, so we keep the value of the previous LDAP operation. As a lot of PHP code rely on ldap_errno to check if bind is successful, we a major security issue here: sending an array as GET/POST parameter to login age can bypass authentication if the code relies on errno. Test script: --------------- <?php error_reporting(0); $badpassword = "test"; $goodpassword = "secret"; $bugpassword[] = "a"; $ldap = ldap_connect("ldap://localhost"); ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); $bind = ldap_bind( $ldap, "cn=admin,dc=example,dc=com" , $badpassword ); $errno = ldap_errno($ldap); echo "Bind 1 returns $errno\n"; $bind = ldap_bind( $ldap, "cn=admin,dc=example,dc=com" , $goodpassword ); $errno = ldap_errno($ldap); echo "Bind 2 returns $errno\n"; $bind = ldap_bind( $ldap, "cn=admin,dc=example,dc=com" , $bugpassword ); $errno = ldap_errno($ldap); echo "Bind 3 returns $errno\n"; Expected result: ---------------- Bind 1 returns 49 Bind 2 returns 0 Bind 3 returns 49 # or any error code Actual result: -------------- Bind 1 returns 49 Bind 2 returns 0 Bind 3 returns 0