BUG: Share page returns HTTP 500 when the unlock cookie contains a non-ASCII character

Aperta Adatta ai principianti
#1,696 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

@swastiksharma45 ci sta già lavorando.

Dal 6/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, security

Direzione di ricerca

Inizia da backend/app/share/registry.py ed esamina share_registry_is_unlocked, poi trova i test che coprono i cookie di sblocco delle condivisioni. Riproduci il comportamento con un cookie contenente é e verifica il comportamento sulle route di condivisione, foto e miniatura. Il lavoro è completato quando un cookie errato con caratteri non ASCII mostra la pagina della password su /s/<token> e restituisce 404 nelle pagine di foto e miniatura, con un test di regressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Is there an existing issue for this?
  • I have searched the existing issues
What happened?

If someone opens a password-protected album share with a cookie that has a non-English character (like "é"), the server returns an error (HTTP 500). It should just show the password page.

Why it happens: in backend/app/share/registry.py, the function share_registry_is_unlocked checks the cookie using hmac.compare_digest. This function throws a TypeError when the text has a non-ASCII character. The visitor sends the cookie, so anyone with the share link can cause this.

How to reproduce: open the link of a password-protected share with a cookie that has a non-English character, like pictopy_share_unlock=café. The server returns 500 instead of the password page.

What should happen: a wrong cookie should be treated like any other wrong cookie. Show the password page on /s/<token>, and return 404 on the photo and thumbnail pages.

Fix idea: compare bytes instead of text, and add a test for it.

I would like to work on this!

Record
  • I agree to follow this project's Code of Conduct
Lingua principale
Python
Stelle
313
Fork
755
Merge medio
6g 36m
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/PictoPy

Tutte le issue di AOSSIE-Org/PictoPy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.