bug: GCS upload detection in MediaManager uses substring match on the full URL
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
In MediaManager._process_upload_media_job (langfuse/_task_manager/media_manager.py), the SDK decides whether an upload target is a GCS bucket with a substring check:
is_self_hosted_gcs_bucket = "storage.googleapis.com" in upload_url
If that matches, the SDK skips the x-ms-blob-type and x-amz-checksum-sha256 headers.
Because it is a substring match on the whole URL, it also matches URLs that are not GCS, for example:
https://example.com/upload?next=storage.googleapis.com(string in the query)https://storage.googleapis.com.example.com/upload(string as a prefix of another domain)
Those uploads are then sent without the headers the SDK would normally add for S3/Azure targets, including the SHA-256 checksum header.
The upload URL comes from the Langfuse server, so I don't see this as exploitable in a normal setup. It is a hardening / correctness fix: the check should look at the URL hostname rather than the raw string.
Proposed fix
Parse the URL and treat it as GCS only when the hostname is storage.googleapis.com or ends with .storage.googleapis.com. Existing behaviour for real GCS URLs (path-style and bucket.storage.googleapis.com) is unchanged.
I have a small PR ready with a unit test in tests/unit/test_media_manager.py that fails before the change and passes after. Happy to open it if this looks good.
Environment
- langfuse-python 4.16.0 (current
main)
- Ngôn ngữ chính
- Python
- Star
- 498
- Fork
- 361
- Merge trung bình
- 16 giờ 58 phút
- Pull request đã merge (30 ngày)
- 32
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 langfuse/langfuse-python
-
bug: get_dataset_run / get_dataset_runs / delete_dataset_run are unusable on Langfuse v4Có thể đã có người làm @hassiebp đã nhận 11 ngày trước. Đang mởbug feat-datasets feat-experiments sdk-python
langfuse/langfuse-python#1906 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mask is not applied to create_dataset_item or create_score(comment=)Có thể đã có người làm @hassiebp đã nhận 15 ngày trước. Đang mởbug compliance feat-data-masking sdk-python security
langfuse/langfuse-python#1896 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Scores bypass sample_rate since v4Có thể đã có người làm @hassiebp đã nhận 20 ngày trước. Đang mởfeat-scores sdk-python unconfirmed-bug
langfuse/langfuse-python#1890 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
batch_evaluation fails on self-hosted v4 events_only deployments (uses unavailable v3 read endpoints)Có thể đã có người làm @hassiebp đã nhận 33 ngày trước. Đang mởbug feat-evals sdk-python
langfuse/langfuse-python#1861 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)Có thể đã có người làm @hassiebp đã nhận 34 ngày trước. Đang mởimprovement sdk-python
langfuse/langfuse-python#1856 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của langfuse/langfuse-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Graphify-Labs/graphify#4241 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
DeviceTrackerĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
XiaoMi/ha_xiaomi_home#1821 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Maven path-index: "Ambiguous or noncanonical artifact path" error does not report the offending pathĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pulp/pulp_maven#524 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày