BUG: Network share serves full unstripped photo with face embeddings and private metadata when thumbnail is missing
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start by reading backend/app/share/media.py and backend/app/share/routes.py, especially share_media_resolve_path, share_thumbnail, and _media_response. Trace how thumbnail requests distinguish generated thumbnails from original photos, then run the relevant share route tests and add coverage for a missing thumbnail. Done means the fallback still returns a thumbnail response without exposing PictoPy metadata from the original photo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
What happened?
When an album is shared over the local network or via the internet tunnel, PictoPy is designed to strip private metadata (facial recognition embeddings, identified person names, and semantic tags) so external guests receive photos without sensitive biometric and identifying data.
However, if an image does not have a cached thumbnail generated on disk (for instance, if the photo was indexed before thumbnail generation finished or if thumbnail generation failed), share_media_resolve_path(album_id, image_id, thumbnail=True) falls back to returning the path to the original full-resolution photo:
# backend/app/share/media.py
path = image.get("thumbnailPath") if thumbnail else image.get("path")
if thumbnail and not path:
path = image.get("path")
The route handler share_thumbnail passes this path to _media_response() with variant="thumb":
# backend/app/share/routes.py
@router.get("/s/{token}/thumb/{image_id}")
def share_thumbnail(
request: Request, token: str = Path(...), image_id: str = Path(...)
) -> Response:
...
path = share_media_resolve_path(entry.album_id, image_id, thumbnail=True)
...
return _media_response(request, path, variant="thumb")
Inside _media_response(), the metadata-stripping logic (open_without_pictopy(path)) is only executed when variant == _PHOTO_VARIANT ("photo-v1"):
# backend/app/share/routes.py
def _media_response(request: Request, path: str, *, variant: str) -> Response:
...
if variant == _PHOTO_VARIANT:
try:
stream = open_without_pictopy(path)
except OSError:
raise _not_found()
if stream is not None:
return StreamingResponse(...)
return FileResponse(path, headers=validators)
Because variant is "thumb", open_without_pictopy(path) is skipped. The server executes return FileResponse(path, headers=validators) on the original photo, transmitting the raw image file with all embedded face embeddings, person names, and private XMP tags directly over the network to the guest via the thumbnail URL.
Steps to Reproduce
- Import an image containing embedded XMP metadata / face tagging.
- Ensure its
thumbnailPathis absent or deleted from the thumbnail directory. - Share the album containing this image over the network (
POST /share/albums/{album_id}). - As an unauthenticated or guest viewer, fetch the thumbnail URL:
GET /s/{token}/thumb/{image_id} - Inspect the downloaded image: it is the original full-size photo with all private facial recognition embeddings and tags intact.
Expected Behavior
Any original photo served by the share server must have PictoPy metadata stripped via open_without_pictopy(), regardless of whether it is requested via /photo/ or as a fallback on /thumb/.
Proposed Fix
In share_thumbnail (or _media_response), check whether the resolved file is an original photo rather than a generated thumbnail, and ensure open_without_pictopy() is invoked for all original photos.
Record
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Python
- Star
- 322
- Fork
- 793
- Merge trung bình
- 6 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AOSSIE-Org/PictoPy
-
bug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AOSSIE-Org/PictoPy#1788 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
AOSSIE-Org/PictoPy#1786 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Có thể đã có người làm @omkar-suryavanshi đã nhận 2 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AOSSIE-Org/PictoPy#1780 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workCó thể đã có người làm @swastiksharma45 đã nhận 4 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AOSSIE-Org/PictoPy#1779 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is offCó thể đã có người làm @Piyush0000 đã nhận 1 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AOSSIE-Org/PictoPy#1770 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của AOSSIE-Org/PictoPy
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 89/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
smk762/argus-atlas#97 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
xdslproject/xdsl#6842 ·
Maintainer thường phản hồi trong vòng 1 ngày