Skip to content
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

Improve password confirmation in UI & API #19525

Merged
merged 14 commits into from Jul 25, 2022
Merged

Improve password confirmation in UI & API #19525

merged 14 commits into from Jul 25, 2022

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Jul 13, 2022

Description:

Our UI and API currently requires a password confirmation for certain (critical) actions. Currently that is done in each vue component and API in a similar way (but own implementations).

This PR introduces a new PasswordConfirmation vue component, that can be easily reused in other components. This also helps to let them look similar across Matomo. All existing password confirmations were replaced with the new component.

The password confirmation check in the API also was done in each class, but will now be available in each API, as it's part of the abstract class.

As confirming passwords introduced issues with other login plugins (that simply don't use passwords), a new event Login.userRequiresPasswordConfirmation was introduced, that allows to disable password confirmation for certain users.
If it's disabled, the API won't perform password checks and in UI the password confirm will still be displayed, but with password input disabled and an enabled submit button, so it can be submitted without entering a password.

Additionally this PR introduces password confirmations for this critical actions:

On Privacy > Anonymize data page it is possible to change the settings for purging old log data and reports as well as directly purging such data. As this is a critical action, that can cause data loss, we will now require the password to be confirmed.

fixes #19335
fixes #19169
fixes https://github.com/matomo-org/matomo-security/issues/209

Review

@sgiehl sgiehl added c: Security For issues that make Matomo more secure. Please report issues through HackerOne and not in Github. Needs Review PRs that need a code review labels Jul 13, 2022
@sgiehl sgiehl added this to the 4.12.0 milestone Jul 13, 2022
@sgiehl sgiehl removed the Needs Review PRs that need a code review label Jul 14, 2022
@sgiehl
Copy link
Member Author

sgiehl commented Jul 14, 2022

Will also implement some changes so we can fix #19169

@sgiehl sgiehl changed the title Require password confirmation for purging old data Refactor and improve password confirmation in UI & API Jul 14, 2022
@sgiehl sgiehl added the c: Usability For issues that let users achieve a defined goal more effectively or efficiently. label Jul 14, 2022
@sgiehl sgiehl added the Needs Review PRs that need a code review label Jul 14, 2022
Copy link
Contributor

@peterhashair peterhashair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go through all the changes, working as expected

@sgiehl
Copy link
Member Author

sgiehl commented Jul 20, 2022

@tsteur would you mind having a quick look at that one? Just want to make sure the implementation with this new event is a solid solution for other login plugins to circumvent the issue, that they don't have a password the user can enter.

@sgiehl sgiehl requested a review from tsteur July 20, 2022 12:59
core/Piwik.php Show resolved Hide resolved
@sgiehl sgiehl merged commit 6cc7236 into 4.x-dev Jul 25, 2022
@sgiehl sgiehl deleted the passwordconfirm branch July 25, 2022 08:58
@justinvelluppillai justinvelluppillai changed the title Refactor and improve password confirmation in UI & API Improve password confirmation in UI & API Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Security For issues that make Matomo more secure. Please report issues through HackerOne and not in Github. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve password confirmation in UI & API Add superuser access to a user is not possible when SSO is used
3 participants