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

オープン 初心者向け
#1,696 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

@swastiksharma45 がすでに取り組んでいます。

2026年11月6日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, security

調査の方向性

backend/app/share/registry.pyから始めてshare_registry_is_unlockedを調べ、次に共有のロック解除Cookieを対象とするテストを探します。éを含むCookieで再現し、共有、写真、サムネイルの各ルートでの動作を確認します。完了条件は、非ASCII文字を含む誤ったCookieの場合、/s/<token>でパスワードページが表示され、写真とサムネイルのページで404が返されることを回帰テストで確認できることです。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Python
スター
313
フォーク
755
平均マージ
6日 36分
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/PictoPy のほかの issue

AOSSIE-Org/PictoPy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。