Skip to content

Extracting e-mail address from LDAP DN fails if OU name includes dot character #33780

@gseric

Description

@gseric

Symfony version(s) affected: 3.4.31

Description
RFC 2253 support is added in #31406 but it doesn't work if any OU name includes dot character (".") - regex in method \Symfony\Component\Security\Http\Firewall\X509AuthenticationListener::getPreAuthenticatedData() fails to select e-mail address.

How to reproduce
Test with the following DN:
emailAddress=john.doe@example.com,CN=John Doe,OU=Foo,OU=Name.With.Dot,DC=Bar

Possible Solution
Change regex to cover described use case.
Consider this one:
#(?:^|,|/)emailAddress=([^,/]+)#
Also, probably it is wise to add before mentioned example as additional test case in \Symfony\Component\Security\Http\Tests\Firewall\X509AuthenticationListenerTest::dataProviderGetPreAuthenticatedDataNoUser()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions