BUG:Backend lets an album be locked with no password, making it permanently inaccessible
Maintainers usually reply within 3 days
@sayxnn17 is already working on this.
Since Nov 14, 2026.
- #1718 by @sayxnn17 — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 65/100
Research direction
Start with the password validation in backend/app/schemas/album.py, where the field validator on the create request is skipped when password is omitted, and with the update_album handler that checks current_password only when the album is already locked. Reproduce both requests from the issue against the album endpoints and confirm they return 200 with a locked album that has no password hash. Done when locking without a new password returns a 400 or 422 on both create and update, and tests cover both paths.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
The album create/update endpoints accept is_locked: true without a password. The album is saved as locked with password_hash = NULL, so verify_album_password rejects every password from then on. Its photos can't be viewed, it can't be unlocked, and the password can't be changed. Deleting it is the only way out.
Cause
The "locked albums need a password" check in backend/app/schemas/album.py is a @field_validator("password"). In Pydantic v2, field validators don't run on default values, so when the request leaves out password entirely, the check is skipped.
UpdateAlbumRequest has a second gap: the check passes whenever current_password is non-empty. But update_album only verifies current_password if the album is already locked, so for an unlocked album any string works.
Steps to reproduce
-
Create path:
POST /albums/ {"name": "A", "is_locked": true}→
200. ThenPOST /albums/{id}/images/getwith any password →401 Invalid Password.PUT /albums/{id}to unlock →401 Incorrect Password. -
Update path (on an existing unlocked album):
PUT /albums/{id} {"name": "B", "is_locked": true, "current_password": "junk", "password": null}→
200 Album updated successfully. The album is now locked with no password and can't be opened.
Expected
Both requests should be rejected with a 400/422 when an album is being locked without a new password.
Notes
The Create/Edit dialogs validate this on the client, so normal UI use doesn't hit it. The backend shouldn't rely on that check, though, and any other client or a future UI change could brick albums.
Suggested fix
- Replace the
passwordfield validator inCreateAlbumRequestwith a@model_validator(mode="after")so it always runs. - In
update_album, return 400 when an album that isn't locked yet is being locked withoutpassword. - Add tests for both paths.
I checked these and I don't think this is a duplicate:
- #1617: locked albums can be deleted without a password (
delete_album). - #1631: images can be added/removed on locked albums without a password.
- #1662: frontend unlock caching; a wrong password briefly opens the album.
All three are about a missing or wrong password check on an album that has a password. This issue is about the backend letting an album be locked with no password stored at all (password_hash = NULL), because the @field_validator("password") in schemas/album.py is skipped when password is omitted, plus the current_password bypass in update_album. After that, no password can open, unlock or edit the album.
The open fixes for those issues (#1675, #1701, #1691) don't touch this validator, so they wouldn't fix this.
I'd like to work on this if it's approved.
Record
- I agree to follow this project's Code of Conduct
- Dominant language
- Python
- Stars
- 322
- Forks
- 793
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/PictoPy
-
bug enhancement
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AOSSIE-Org/PictoPy#1802 · 2 comments ·
Maintainers usually reply within 3 days
-
BUG: XMP metadata export permanently overwrites file modification timestamp (mtime), destroying photo datesPossibly taken @swastiksharma45 claimed this 2 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/PictoPy#1788 · 6 comments ·
Maintainers usually reply within 3 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
AOSSIE-Org/PictoPy#1786 · 1 comment ·
Maintainers usually reply within 3 days
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Possibly taken @omkar-suryavanshi claimed this 3 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/PictoPy#1780 · 5 comments ·
Maintainers usually reply within 3 days
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workPossibly taken @ManyaJain111 claimed this 2 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/PictoPy#1779 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
All issues in AOSSIE-Org/PictoPy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Possibly taken @cestercian claimed this today. Opencomp/cli P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#162259 · 1 comment ·
Maintainers usually reply within 1 day
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
conan-io/conan-center-index#31597 ·
Maintainers usually reply within 1 day
-
community-request
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Run#727 ·
Maintainers usually reply within 1 day
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
pytorch/pytorch#207247 · 1 comment ·
Maintainers usually reply within 1 day