Jump to content
Froxlor Forum
  • 0

Passwort vergessen Funktion ohne Fehlermeldung


gamefreaktegel

Question

Hallo zusammen,

mir ist aufgefallen, dass bei Nutzung der "Passwort vergessen"-Funktion nach dem Setzen des neuen Passworts eine Exception fliegt, wenn das Passwort nicht den Minimalanforderungen genügt. Dabei erhält der Benutzer jedoch nur eine weiße Seite.

Kann das jemand nachvollziehen?

 

Froxlor 0.10.12-1 per Debian APT unter Buster, FCGID

[Thu Feb 06 22:12:19.124557 2020] [fcgid:warn] [pid 50733] [client x.x.x.x:55458] mod_fcgid: stderr: PHP Fatal error:  Uncaught Exception: Die vorgegebene Passwort-Komplexit\xc3\xa4t wurde nicht erf\xc3\xbcllt.Bitte kontaktieren Sie Ihren Administrator, wenn Sie Fragen zur Komplexit\xc3\xa4ts-Vorgabe haben. in /var/www/froxlor/lib/Froxlor/UI/Response.php:120, referer: https://srv.example.tld/froxlor/index.php?action=resetpwd&resetcode=5798de555187b31158102343831574a20f7be6d6b711e7c60c
[Thu Feb 06 22:12:19.124575 2020] [fcgid:warn] [pid 50733] [client x.x.x.x:55458] mod_fcgid: stderr: Stack trace:, referer: https://srv.example.tld/froxlor/index.php?action=resetpwd&resetcode=5798de555187b31158102343831574a20f7be6d6b711e7c60c
[Thu Feb 06 22:12:19.124578 2020] [fcgid:warn] [pid 50733] [client x.x.x.x:55458] mod_fcgid: stderr: #0 /var/www/froxlor/lib/Froxlor/Validate/Validate.php(62): Froxlor\\UI\\Response::standard_error(Array, '/.*[A-Z]+.*/', 'new password'), referer: https://srv.example.tld/froxlor/index.php?action=resetpwd&resetcode=5798de555187b31158102343831574a20f7be6d6b711e7c60c
[Thu Feb 06 22:12:19.124580 2020] [fcgid:warn] [pid 50733] [client x.x.x.x:55458] mod_fcgid: stderr: #1 /var/www/froxlor/lib/Froxlor/System/Crypt.php(165): Froxlor\\Validate\\Validate::validate('asddsdjc', '/.*[A-Z]+.*/', '/.*[A-Z]+.*/', 'notrequiredpass...', Array, 'new password'), referer: https://srv.example.tld/froxlor/index.php?action=resetpwd&resetcode=5798de555187b31158102343831574a20f7be6d6b711e7c60c
[Thu Feb 06 22:12:19.124582 2020] [fcgid:warn] [pid 50733] [client x.x.x.x:55458] mod_fcgid: stderr: #2 /var/www/froxlor/index.php(605): Froxlor\\System\\Crypt::validatePassword('asddsdjc', 'new password'), referer: https://srv.example.tld/froxlor/index.php?action=resetpwd&resetcode=5798de555187b31158102343831574a20f7be6d6b711e7c60c
[Thu Feb 06 22:12:19.124592 2020] [fcgid:warn] [pid 50733] [client x.x.x.x:55458] mod_fcgid: stderr: #3 {main}, referer: https://srv.example.tld/froxlor/index.php?action=resetpwd&resetcode=5798de555187b31158102343831574a20f7be6d6b711e7c60c

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

1. Klick auf "Passwort vergessen?"

-> froxlor/index.php?action=forgotpwd

2. Eingabe von Benutzernamen und dessen E-Mail-Adresse

3. Klick auf "Passwort zurücksetzen"

4. E-Mail erhalten, Klick auf die URL in der E-Mail

-> froxlor/index.php?action=resetpwd&resetcode=0cb2b93...…...

5. Eingabe des neuen Passworts bei "Passwort" und "Passwort bestätigen" (das Passwort entspricht nicht den Komplexitätsregeln)

6. Klick auf "Passwort zurücksetzen"

7. Nur eine weiße Seite erscheint und man hat die Exception im Log

 

Die Funktion funktioniert einwandfrei, wenn ein Passwort eingegeben wird, welches den Regeln entspricht.

pwrichtlinien.PNG

Link to comment
Share on other sites

  • 0

Behebt folgender Patch die Problematik?

diff --git a/index.php b/index.php
index bfc6282a..e340c265 100644
--- a/index.php
+++ b/index.php
@@ -598,21 +598,18 @@ if ($action == 'resetpwd') {
                                ));
 
                                if ($result !== false) {
-                                       if ($result['admin'] == 1) {
-                                               $new_password = \Froxlor\Validate\Validate::validate($_POST['new_password'], 'new password');
-                                               $new_password_confirm = \Froxlor\Validate\Validate::validate($_POST['new_password_confirm'], 'new password confirm');
-                                       } else {
-                                               $new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password');
-                                               $new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
+                                       try {
+                                               $new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], true);
+                                               $new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], true);
+                                       } catch (Exception $e) {
+                                               $message = $e->getMessage();
                                        }
 
-                                       if ($new_password == '') {
-                                               $message = $new_password;
-                                       } elseif ($new_password_confirm == '') {
-                                               $message = $new_password_confirm;
-                                       } elseif ($new_password != $new_password_confirm) {
-                                               $message = $new_password . " != " . $new_password_confirm;
-                                       } else {
+                                       if (empty($new_password) || $new_password != $new_password_confirm) {
+                                               $message = $lng['error']['newpasswordconfirmerror'];
+                                       }
+
+                                       if (empty($message)) {
                                                // Update user password
                                                if ($result['admin'] == 1) {
                                                        $stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "`

 

Link to comment
Share on other sites

  • 0

Moin d00p,

vielen Dank! Funktioniert!

 

Minimale Kosmetik fehlt natürlich noch, es erscheint folgender Text (Passwort ist natürlich in beiden Felder korrekt eingetragen worden):
 

Quote

 

Fehlermeldung

Das neue Passwort und dessen Bestätigung sind nicht identisch.

 

Hier sollte eine Meldung ala "Das Passwort entspricht nicht den Komplexitätsregeln" erscheinen.

Der Positivtest war auch erfolgreich (nach Eingabe eines konformen Passworts wird dieses zurückgesetzt).

Danke für die schnelle Hilfe :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...