TeamPass
TeamPass copied to clipboard
LDAP-Password with '<' don't work
Steps to reproduce
- set pw of test-user in LDAP with '<'
- Configure LDAP in Teampass
- Try Login at startpage or LDAP-Config-Page
Expected behaviour
Login should work
Actual behaviour
Login at startpage and test at LDAP-Config-Page don't work if the LDAP-PW has '<' inside. A local user with the same password works.
Server configuration
Operating system: Ubuntu 20.04 Web server: Apache 2.4.41 Database: MySQL 8.0.29 PHP version: 7.4.3 Teampass version: 3.0.0.18
I also faced this. I found problem line here
$userCredentials = identifyGetUserCredentials(
$SETTINGS,
(string) $server['PHP_AUTH_USER'],
(string) $server['PHP_AUTH_PW'],
(string) filter_var($dataReceived['pw'], FILTER_SANITIZE_STRING),
(string) filter_var($dataReceived['login'], FILTER_SANITIZE_STRING)
);
Fourth parameter (user provided password) was filtered using FILTER_SANITIZE_STRING, which encodes < > and quotes.
I don't know why we need encode tags in user password because it's will be never shown.
Maybe we don't need to filter_var password? Because password can contain any character