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

Đang mở Phù hợp với người mới
#1,696 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

@swastiksharma45 đang làm issue này rồi.

Từ ngày 6/11/2026.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, security

Hướng nghiên cứu

Bắt đầu với backend/app/share/registry.py và kiểm tra share_registry_is_unlocked, sau đó tìm các bài kiểm thử bao quát cookie mở khóa chia sẻ. Tái hiện bằng cookie có chứa é và xác minh hành vi trên các route chia sẻ, ảnh và hình thu nhỏ. Công việc hoàn tất khi cookie sai có ký tự không phải ASCII hiển thị trang mật khẩu tại /s/<token> và trả về 404 trên các trang ảnh và hình thu nhỏ, kèm theo một bài kiểm thử hồi quy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
313
Fork
755
Merge trung bình
6 ngày 36 phút
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AOSSIE-Org/PictoPy

Tất cả issue của AOSSIE-Org/PictoPy

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.