Bug #72021 [NEW]: LDAP Escape DN Not RFC 4514 Compliant

From: Date: Wed, 13 Apr 2016 23:56:59 +0000
Subject: Bug #72021 [NEW]: LDAP Escape DN Not RFC 4514 Compliant
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200537@lists.php.net to get a copy of this message
From:             chad dot sikorra at gmail dot com
Operating system: Linux
PHP version:      5.6.20
Package:          LDAP related
Bug Type:         Bug
Bug description:LDAP Escape DN Not RFC 4514 Compliant

Description:
------------
Per RFC 4514, leading/trailing spaces should be escaped for a DN.
Additionally, carriage returns should also be escaped. Currently the
ldap_escape method does not doe this. I verified (in Active Directory
anyway) that this really is the case, as LDAP refuses to add a LDAP
object with a DN passed through the ldap_escape method with a DN flag
set when it contains any of the mentioned cases.

https://www.ietf.org/rfc/rfc4514.txt

Test script:
---------------
var_dump(ldap_escape(" Joe,= \rSmith ", null, LDAP_ESCAPE_DN));

Expected result:
----------------
It should output:

'\20Joe\2c\3d \0dSmith\20'

Actual result:
--------------
Currently outputs:

" Joe\2c\3d \rSmith "

-- 
Edit bug report at https://bugs.php.net/bug.php?id=72021&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=72021&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=72021&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=72021&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=72021&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=72021&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=72021&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=72021&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=72021&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=72021&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=72021&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=72021&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=72021&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=72021&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72021&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=72021&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=72021&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=72021&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72021&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=72021&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=72021&r=mysqlcfg



Thread (1 message)

  • chad dot sikorra at gmail dot com
« previous php.bugs (#200537) next »