26 Commits
Author SHA1 Message Date
Rodrigo Cortés Cano 1eaaecfcbc Show configured MFA status and add CLI reset commands (#1196)
The administrator list shows a translated Yes/No MFA column immediately after Active. 
Domains display an MFA badge only when at least one mailbox has a configured secret. 

Add resetmfa task for the postfixadmin-cli command. ( postfixadmin-cli admin resetmfa <address> and
postfixadmin-cli mailbox resetmfa <address> )

thanks @TrapoSAMA
2026-11-18 13:22:21 +00:00
Rodrigo Cortés Cano b14e323af7 Add Cancel navigation to create/edit forms and mail composers (#1181)
Create and edit forms currently lack a Cancel action, making administrators and mailbox users rely on browser navigation or menus to abandon changes. The individual and broadcast mail composers have the
same gap.

thanks @TrapoSAMA
2026-11-01 10:44:23 +00:00
Rodrigo Cortés Cano 3feeb081af Escape security lists and make template escaping opt-outs explicit (#1172)
fixes potential XSS issue with TOTP exception lists (which need escaping, see also #1185). 

refactors Template escaping to use TemplateEscape enum (rather than the previous boolean).

thanks @TrapoSAMA
2026-11-01 10:41:54 +00:00
David Goodwin ae85e51f6e Security fixes (master only) (#1165)
Someone wishing to remain anonymous emailed @cboltz a number of security issues, summarised below.

1. fix sql injection bug in getPageBrowser - search keys bypass the field filter, due to 2a6f27c3 / #1127
2. when performing a password change, do not start the session before the new password has been validated for compexity etc - as things stand someone with a recovery code gets logged in even if their password gets
rejected. Also invalid recovery code on failure.
3. broadcast-message.php was using smtp_mail() with incorrect args, and passing the SMTP password in as the mail body. - probably related to commit 7f1d78e and 42a664e9c2
4. a regular (non-admin) user could submit an arbitrary username in the POST data and create/edit a TOTP exception for another user or entire domain

PR includes refactoring of the password change code (into PasswordChangeAttempt) to make it easier to test/verify.
2026-10-17 09:27:59 +01:00
Rodrigo Cortés Cano 3ab0104d1a Address forwarding editor review feedback 2026-07-22 18:13:16 +00:00
Rodrigo Cortés Cano 9a9078ce21 Unify user and admin forwarding editor 2026-07-22 18:13:16 +00:00
David Goodwin 8a1f9a11af CSRF protection - support multiple tokens (#985)
possible fix for https://github.com/postfixadmin/postfixadmin/issues/967

CSRF Token changes : rather than have one PFA_Token value in $_SESSION, store a list of them, where each value has a time stamp it was issued on. The aim is to allow the user to have multiple browser tabs open at once - and not have the last tab that loaded trample on others. Tokens expire after 1 hour.

Adds a Smarty helper function `{CSRF_Token}` which will output `<input type=hidden name=CSRF_Token value=asdf123>` or `{CSRF_Token type=url}` which outputs a literal string like 'asdf123' suitable for placing in a URL.

Adds a PHP exception handler in public/common.php, which could be used to display a more friendly error message/response (but at the moment is fairly minimal).

Removes most uses of `die()` within the codebase, and instead moves to throw an exception
2026-03-01 19:30:16 +00:00
David Goodwin cb91ae64f2 formatting 2026-02-28 16:41:45 +00:00
Fredrik Boström 902739f96d WIP: TOTP reset for lost secrets (#988)
add TOTP reset for lost secrets - see #924
2026-02-28 10:15:07 +00:00
David Goodwin dd24020de2 formatting 2026-01-28 09:50:26 +00:00
David Goodwin ff0a3d7636 psalm stuff, add Languages class, token refactor 2026-01-28 09:50:26 +00:00
David Goodwin 52794bede7 misc fixes for psalm after allowing it to be updated 2026-01-28 09:50:26 +00:00
David Goodwin 460c624275 remove more references to sourceforge 2025-07-13 18:29:37 +01:00
David Goodwin 759304ecb8 apparently these all need reformatting 2024-12-05 14:33:41 +00:00
David Goodwin 6cc7922284 see #642 - possible fix for pagination being lost 2022-07-25 09:44:12 +01:00
Unknown 029d749fb8 Redirect to listview after editing 2021-07-05 15:39:51 -03:00
David Goodwin 750838d7f7 psalm fixes; make safepost()/safeget() return strings 2020-11-09 21:40:52 +00:00
David Goodwin 8bfe9fe668 Rejig PFASmarty, so it becomes a singleton accessible to the various 'controllers'.
(PFASmarty::getInstance() ... stops a global variable at least).
2020-09-27 10:49:58 +01:00
David Goodwin d7fa33a3ed s/store/save/g 2020-09-25 21:43:34 +01:00
David Goodwin 8754af58cb fix undefined variables (psalm) 2020-03-12 20:45:51 +00:00
David Goodwin bcae218cbb composer format time 2019-10-19 21:36:27 +01:00
David Goodwin b8d7c0513f psalm fix 2019-10-17 20:03:47 +01:00
David Goodwin 95429a6963 reindent, remove comment 2019-06-08 20:05:59 +01:00
Christian Boltz d2588a4de2 Fix phpcs whitespace breakage in initStruct etc. 2018-04-22 18:24:41 +02:00
Adrien Crivelli 15df6c1d7b Reformat everything with PHP-Cs-Fixer 2018-01-26 23:54:37 +09:00
David Goodwin 99147d51eb move public facing stuff into public/, this allows us to stop exposing templates_c/ etc to the world 2018-01-25 20:27:09 +00:00