PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be edited

Open ManyaJain111 opened this issue 1 month ago • 8 comments

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:

  1. Create a locked album with password secret (space at the end)
  2. Open the album with secret - works
  3. ⋮ > Edit Album, current password secret , change the name, save
  4. 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

ManyaJain111 avatar Oct 22 '26 07:10 ManyaJain111

👋 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 :)

github-actions[bot] avatar Oct 22 '26 07:10 github-actions[bot]

If this is deemed a relevant issue , can I work on this?

ManyaJain111 avatar Oct 22 '26 07:10 ManyaJain111

⚠️ Potential Duplicate Issue (Semantic Match)

This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:

  1. 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%

  2. 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%

  3. 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.

github-actions[bot] avatar Oct 22 '26 07:10 github-actions[bot]

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.

ManyaJain111 avatar Oct 22 '26 08:10 ManyaJain111

Link your account with Gitcord

Thanks for opening this issue, @ManyaJain111!

To receive Discord notifications and contributor tracking for this organization:

  1. Join Discord: https://discord.gg/hjUhu33uAn
  2. In Discord, run /link ManyaJain111
  3. Paste the verification code into your GitHub bio (or a public gist)
  4. Click Verify in Discord (or run /verify-link ManyaJain111)

Once linked, Gitcord can notify you about assignments, mentions, and more.

— Posted by Gitcord

gitcordapp[bot] avatar Oct 22 '26 10:10 gitcordapp[bot]

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

Prakhar1808 avatar Oct 22 '26 18:10 Prakhar1808

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?

ManyaJain111 avatar Oct 23 '26 06:10 ManyaJain111

Thanks for validating!

Great and only Open a PR only when you're assigned to the issue

Prakhar1808 avatar Oct 23 '26 10:10 Prakhar1808