BUG: A locked album can be shared over the network without its password
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
On the Albums page, a locked album can be shared from its menu without entering the album's password.
Steps to reproduce
- Create an album and lock it with a password.
- On the Albums page, open the album's ⋯ menu and choose Share.
- The share dialog opens straight away. No album password is asked for.
- Create a link with Require a password turned off.
- Open the link from another device on the network.
Expected
Sharing a locked album should need its password, the same as opening it does (clicking a locked album opens the password dialog first).
Actual
Anyone with the link can see every photo in the album. The lock protects the album inside the app, but the share option exposes it to the network without the password.
Where
frontend/src/pages/Album/Album.tsx:handleShareAlbumopens the share dialog directly, whilehandleAlbumClickasks for the password first for a locked album.backend/app/share/media.py:share_media_album_namenotes thatis_lockedis deliberately ignored, because sharing has its own authorization. That authorization is optional, though, so a locked album can be shared with none.
Possible fixes
- For a locked album, ask for the album password before the share dialog opens. Verify it with the backend's existing album password check (
verify_album_password) so the check is not frontend-only. - Or require a share password whenever the album is locked.
Option 1 matches how opening a locked album already works. I would be happy to work on whichever the maintainers prefer.
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 :)
Discussions are carried on Discord.
Instead of commenting here, join the AOSSIE Discord server and go to Projects → PictoPy.
If you find this project useful, a GitHub star would be appreciated.
Possibly related issues
These existing issues look similar. This is an automated suggestion: if none of them apply, no action is needed.
Open
- #1713
- #1617
If one of these describes the same problem, consider adding your details there instead.