-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot authentificate with a specific special character in password #5
Comments
I have same problem with czech symbols ěščřžýáíé |
Hi, Sorry for the delay to the initial post. I started to look in to this and then dropped it. Coming back to it today, I don't have an answer but we don't seem to be alone with the problem. Here are a couple similar reports: https://serverfault.com/questions/644046/%C2%A3-sign-in-password-fails-windows-nps-radius-authentication-against-sonicwall-sra Using dapphp/radius client to auth against FreeRADIUS, I can auth fine with passwords such as Password1£, ěščřžýáíé1@#, 😎 🐈 🏃 🐎 ¯_(ツ)_/¯, пассворд1! etc etc. Similarly, Using Windows Server 2016, copying the For example:
Then changing password:
Similarly, it will not work with ěščřžýáíé1@#. In all cases, the NPS server logs a generic password mismatch error like:
It would seem that PAP would be a good test case as it's the simplest algorithm for encoding a password. I've also tried with and without multi-byte aware code, though it seems we should be operating on bytes, and not characters. I have confirmed that PAP auth using the current code works fine against FreeRADIUS. I can't turn up any useful information as to what the problem is or what, if any, solutions there are. Anyone have any ideas? I'm going to try some Radius clients made for Windows next, locally on the server. |
Hi, We´re also using version 2.5.4 and detect the authentication error with special characters. We use Windows Server 2016 and the passwords work with our the domain. The problem seems to be that the library interprets all characters with 1 byte (basic UTF-8) while special characters are encoded with more than 1 byte (see column UTF-8(hex.) in https://www.utf8-chartable.de/unicode-utf8-table.pl?names=-&unicodeinhtml=hex). The solution is to update the code implementing it with the functions that contemplate the possibility of more than 1 byte to code (implementations mb (multibyte string) -> https://www.php.net/manual/en/book.mbstring.php). We have reviewed the code and have developed a possible implementation of the str2unicode($str) function (Pear_CHAP.php file): PROBLEM: Example: Spanish character ñ
We have tested the solution on our system using EAP-MSCHAPv2 authentication. Regards, Miguel. |
Issue dapphp#5 : Cannot authentificate with a specific special character in password. Add support for multibyte string (https://www.php.net/manual/en/book.mbstring.php) in str2unicode function (Pear_CHAP.php). Function interprets all characters with 1 byte (basic UTF-8) while special characters are encoded with more than 1 byte (see column UTF-8(hex.) in https://www.utf8-chartable.de/unicode-utf8-table.pl?names=-&unicodeinhtml=hex).
NOTE: This proposal only work with PHP >= 7.2. mb_ord function was added in this version (https://www.php.net/manual/en/function.mb-ord.php). For use with older php versions, function can can be manually coded (like https://github.com/symfony/polyfill-mbstring/blob/master/Mbstring.php). |
Hi Miguel (@mportelag), Thank you for the work on this. When I test it, it does fix auth for password Password1£, but I still get incorrect password errors for пассворд1@@ and ěščřžýáíé1@#. Maybe it's something with my test Windows server or NPS setup. Are you able to auth either of those passwords using your fix? I can't auth using any of these passwords when testing with FreeRADIUS |
Hi @dapphp , |
Maybe this is relevant: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/6e803168-f140-4d23-b2d3-c3a8ab5917d2
|
Hi,
I'm using the version 2.5.4 of your library. When a user try to authentificate with a password containing the
£
character, the authentification fails.I used a Windows Server 2016 and the password is working within the domain.
Best regards,
The text was updated successfully, but these errors were encountered: