BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be edited
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
If a locked album's password ends (or starts) with a space, I can still open the album, but editing it always fails with "The current password is incorrect", even with the right password.
Steps To Recreate:
- Create a locked album with password
secret(space at the end) - Open the album with
secret- works - ⋮ > Edit Album, current password
secret, change the name, save - Error: "The current password is incorrect"
Without the space it fails too, so the album can't be edited at all. The cause seems to be EditAlbumDialog.tsx line 105 and 110, it does .trim() on current_password and password before sending. Create and unlock don't trim, so the passwords never match. Same thing in reverse: if you lock an album from Edit with pass, it gets saved as pass.
I think removing the trim from those two lines (keeping it only for the empty check) would fix it.
Record
- [x] I agree to follow this project's Code of Conduct
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
If this is deemed a relevant issue , can I work on this?
⚠️ Potential Duplicate Issue (Semantic Match)
This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:
-
BUG: Password-protected locked albums can be deleted without providing a password (#1617, open) https://github.com/AOSSIE-Org/PictoPy/issues/1617 Similarity: 71.4%
-
BUG: Add/remove image endpoints allow mutations on locked albums without password verification (#1631, open) https://github.com/AOSSIE-Org/PictoPy/issues/1631 Similarity: 68.4%
-
BUG: Backend: Backend crashes when password contains null bytes (x00) (#1026, open) https://github.com/AOSSIE-Org/PictoPy/issues/1026 Similarity: 61.5%
Please review before proceeding.
This isn't a duplicate of the linked issues. #1617 and #1631 are about endpoints that don't check the password at all. This one is about the Edit Album dialog trimming the password before sending it, so the correct password gets rejected and the album can't be edited. #1026 is about null bytes crashing the backend, which is unrelated.
Link your account with Gitcord
Thanks for opening this issue, @ManyaJain111!
To receive Discord notifications and contributor tracking for this organization:
- Join Discord: https://discord.gg/hjUhu33uAn
- In Discord, run
/link ManyaJain111 - Paste the verification code into your GitHub bio (or a public gist)
- Click Verify in Discord (or run
/verify-link ManyaJain111)
Once linked, Gitcord can notify you about assignments, mentions, and more.
— Posted by Gitcord
issue tested and validated! it is a real issue what approach are we taking? a) removing trailing spaces being set as passwords b) remove the secret trimming of the code c) something else you have in mind
Thanks for validating! I'd go with , Create Album, the unlock dialog and the backend all using the password exactly as typed. Only Edit Album trims it which is why the correct password gets rejected. I'll remove the trimming there and keep .trim() only for the empty-password check. If that works for you an I open a PR with the fix and a test?
Thanks for validating!
Great and only Open a PR only when you're assigned to the issue