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

Make Matomo compatible with passwords containing certain special characters #20048

Merged
merged 9 commits into from Dec 14, 2022

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Nov 24, 2022

Description:

Matomo currently uses a system to auto sanitize parameters. This is also done for parameters like password or passwordConfirmation. In some place those parameters are even sanitized twice, causing an unsanitize not to result in the same password as before.

As the password is a parameter that will never get printed anywhere it should be totally safe to never sanitize those parameter.
This PR aims to change that everywhere. In addition I've tried to update the tests, so they are using a password containing various special chars.

As this changes the password use for our test fixture, it might be required to update some plugin tests after merging...

fixes #20021
fixes #19857

Review

@sgiehl sgiehl changed the base branch from 4.x-dev to 5.x-dev November 25, 2022 10:19
@sgiehl sgiehl added this to the 5.0.0 milestone Nov 25, 2022
@sgiehl sgiehl force-pushed the passwordsanitize branch 5 times, most recently from fb75fe2 to 4c5a3f7 Compare November 25, 2022 16:52
@sgiehl sgiehl marked this pull request as ready for review December 1, 2022 13:52
@sgiehl sgiehl added the Needs Review PRs that need a code review label Dec 1, 2022
Copy link
Contributor

@bx80 bx80 left a comment

Choose a reason for hiding this comment

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

It looks like the special handling for the 'segment' parameter was removed, is this now covered by the @unsanitized annotation?

We might need a paragraph for the developer docs to explain how to safely use this functionality, for example - the best practice for a method that has multiple parameters but only one needs to be unsanitized.

@sgiehl
Copy link
Member Author

sgiehl commented Dec 12, 2022

@bx80 The special handling for segment was only moved some lines above, as it actually didn't work in case no default value was provided.

I've also added some docs around the sanitizing in matomo-org/developer-documentation#684

Copy link
Contributor

@bx80 bx80 left a comment

Choose a reason for hiding this comment

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

This looks good to me 👍

@sgiehl sgiehl merged commit 8c7346e into 5.x-dev Dec 14, 2022
@sgiehl sgiehl deleted the passwordsanitize branch December 14, 2022 10:18
@justinvelluppillai justinvelluppillai removed the Needs Review PRs that need a code review label Jan 12, 2023
@sgiehl sgiehl added the Bug For errors / faults / flaws / inconsistencies etc. label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passwords containing special chars do not work correctly User Deletion throws error "Password is too weak"
3 participants