Commit Graph
76 Commits
Author SHA1 Message Date
Rodrigo Cortés Cano 0a894b0876 [4.x] Fix stored XSS in TOTP-exception and application-password lists (#1186)
Stored TOTP-exception and application-password descriptions bypass PFASmarty escaping on maintained 4.x, allowing mailbox-controlled markup to execute when a global administrator views the lists. Both controllers
now use the existing recursive HTML escaping so stored descriptions render as text, including records already in the database.

thanks @TrapoSAMA
2026-11-01 16:17:55 +00:00
David Goodwin e16ed06976 fix from #1156, see also 3566e195c1 2026-09-29 12:05:32 +00:00
David Goodwin 2ee2504e56 should not need to pass in false here, as the init_session should have written mfa_complete to true etc 2026-09-29 12:05:32 +00:00
David Goodwin 77ccefdbf2 fix incomplete MFA logins having the ability to change state
when a user is part way through an MFA login (username/password auth done, but not the MFA bit),
authentication_get_username() will return their current username. This function is used in various other places
and historically it was a suitable check to determine if someone was also authenticated.

Commit updates authentication_get_username() to include a call to authentication_mfa_incomplete() by default, the only exclusion being on the login-mfa.php pages.

Thanks to Wenhao Wu (Southeast University) for the security report "MFA-incomplete (password-only) mailbox session can rewrite its own alias forwarding via /edit.php (CWE-308)"
2026-09-29 12:05:32 +00:00
Rodrigo Cortés Cano b5198b3ab3 4.x: require reauthentication for TOTP removal (#1135)
Require a completed authenticated role for TOTP management and verify the current password before removing a TOTP secret. 

See #1129 and #1128

thanks @TrapoSAMA
2026-09-16 15:00:47 +01:00
Rodrigo Cortés Cano f29ac152fb 4.x: harden password recovery requests (#1136)
Require a validated canonical site_url for recovery links, keep responses uniform, and persist a five-minute per-account request limit.

This ports the behavior of PR #1130 while preserving PHP 7.4 compatibility and the 4.x database boolean handling.

Refs #1128

Thanks @TrapoSAMA
2026-09-02 20:29:26 +01:00
Rodrigo Cortés Cano 719935d17a Improve error message for expired CSRF token errors
This backports the invalid-token/session-expired UX improvement to the 4.0 branch.

When a session expires and an old CSRF token is submitted, PostfixAdmin 
currently shows a raw invalid token error. 

This change renders a translated session-expired page instead, returning HTTP 419.

thanks @TrapoSAMA
2026-07-03 18:38:14 +01:00
David Goodwin 75dfa2fec1 psalm 2026-06-13 09:42:28 +01:00
David Goodwin 0be8a6c7af formatting 2026-06-13 09:39:16 +01:00
Fredrik Boström 8e6457e15b Fix pw recovery without totp (#1032)
Check if user has TOTP active, if so display input field in pw-change form and evaluate it.
2026-05-23 14:29:38 +01:00
Christian Boltz 4b20d2be2b Fix hardcoded table name mailbox_app_password
... which exploded when using custom table names.
2025-09-11 22:39:57 +02:00
Christian Boltz d50d171914 Fix 404 when loading css etc. for admins
For admins, the relative path to css etc. is '', not '../'
2025-09-11 21:56:35 +02:00
David Goodwin 460c624275 remove more references to sourceforge 2025-07-13 18:29:37 +01:00
David Goodwin 798e8b269c Topt app passwords fixes (WIP) (#805)
various improvements to the TOTP code see also:  #802
2025-05-16 20:31:20 +01:00
David Goodwin 759304ecb8 apparently these all need reformatting 2024-12-05 14:33:41 +00:00
David Goodwin 56dd787ce2 when going through password recovery, only wipe the recovery token after the user has updated their password
see https://github.com/postfixadmin/postfixadmin/issues/550
2024-05-17 22:02:01 +01:00
David Goodwin f01274ec94 try relaxing composer dependencies to allow php8.2 dev support, reformat so composer format passes 2024-04-22 21:02:01 +01:00
David Goodwin 8c1369068f fix #801 - incorrect path for common.php 2024-02-06 08:29:54 +00:00
David Goodwin 64c34b2c0a fix deletion of app password - see #800 2024-02-05 20:30:31 +00:00
David Goodwin ccbf3f9ab3 reformat/reorganise code 2023-12-23 21:59:33 +00:00
David Goodwin 8003978ca5 type hints etc and todo notes 2023-12-23 21:55:50 +00:00
David Goodwin 824ba906b1 more type hints 2023-12-23 21:49:57 +00:00
David Goodwin 015d4ec9cd reindent / reformat; add type hints for some of the app password stuff; try and make sure someone can only remove their own app password (see revokeAppPassword() ) 2023-12-23 21:43:31 +00:00
David Goodwin 4d17aa6ef9 manaul merge in of verdigado:master (see #753) (MFA/TOTP support) 2023-12-23 17:05:52 +00:00
David Goodwin 65aea00a1f see https://github.com/postfixadmin/postfixadmin/issues/667 - re-use smtp_get_admin_email(), try and make sure there is a From: set in password recovery emails 2022-11-30 21:18:06 +00:00
David Goodwin 2d6ded2786 PSR2 -> PSR12 formatting 2022-06-28 13:46:11 +01:00
David Goodwin ef36710ea7 print a better error message when password change is blocked 2022-06-11 09:03:03 +01:00
David Goodwin bf273904e6 indentation / stray ; 2021-08-04 20:36:52 +01:00
David Goodwin 25ac89f6a7 see https://github.com/postfixadmin/postfixadmin/issues/523 - improve randomness when creating the PFA_token field; reported by @michaellrowley via huntr.dev. 2021-08-04 17:00:55 +01:00
David Goodwin 269515b1ad see: https://github.com/postfixadmin/postfixadmin/issues/105 - log the ip address from the users/login.php page too 2021-04-22 12:53:40 +01:00
David Goodwin 2edabc3e03 phpcs insists on some brace changes 2021-04-13 21:19:16 +01:00
David Goodwin c755e82a36 Merge branch 'postfixadmin_3.3' 2021-02-18 12:12:27 +00:00
David Goodwin b2831d1241 psalm improvements 2021-02-17 21:29:18 +00:00
David Goodwin d9813d4cf8 see #446 - try and detect site url but allow for $CONF['site_url'] override to be used. 2021-02-07 20:35:58 +00:00
David Goodwin 7f8a3d4bde also fix password-change include path - see https://github.com/postfixadmin/postfixadmin/issues/430 2021-01-21 13:57:31 +00:00
David Goodwin 829b27fc20 re-fix password-change 2021-01-21 13:54:53 +00:00
David Goodwin e10f6f3df5 merge postfixadmin_3.3 into master 2021-01-21 13:52:41 +00:00
David Goodwin dd86dcad30 fix forget-password (+ themeing), see #427 2021-01-19 09:19:59 +00:00
David Goodwin 95b431599d fix forget-password (+ themeing), see #427 2021-01-19 09:19:30 +00:00
David Goodwin 70bf59edc4 composer format; fix syntax issue; comment out code in model/Login which fails psalm check 2021-01-14 22:22:27 +00:00
David Goodwin cb161a7cec Merge pull request #421 from BotoX/master-crypt
Suport for dovecot mail-crypt-plugin via new mailbox_postpassword_script hook
2021-01-14 20:11:14 +00:00
David Goodwin 79737bc049 reformat 2021-01-14 17:07:55 +00:00
David Goodwin 61585e8b02 do not lose login error for users/ - see https://github.com/postfixadmin/postfixadmin/issues/420 2021-01-14 17:07:55 +00:00
David Goodwin 0ca76d82f5 indent 2021-01-14 17:07:55 +00:00
David Goodwin 18a019690c reformat 2021-01-14 11:26:04 +00:00
David Goodwin 24eb45be92 do not lose login error for users/ - see https://github.com/postfixadmin/postfixadmin/issues/420 2021-01-14 11:22:53 +00:00
David Goodwin 1ac1eb07d5 indent 2021-01-13 10:52:15 +00:00
BotoX c6ae3ea2f3 Suport for dovecot mail-crypt-plugin via new mailbox_postpassword_script hook.
Uses doveadm mailbox cryptokey on create user / password change to adjust user encryption key.
https://doc.dovecot.org/configuration_manual/mail_crypt_plugin/
2021-01-11 21:07:45 +01:00
Christian Boltz c2571694d1 Drop now unused users/css/default.css 2021-01-11 20:57:04 +01:00
David Goodwin c7850b78eb fix bootstrap theme for users/ urls; make some other links use https. 2021-01-07 20:34:06 +00:00