bug: GCS upload detection in MediaManager uses substring match on the full URL
メンテナーはふだん 1 日以内に返信
@hassiebp がすでに取り組んでいます。
2026年9月30日 から。
評価
この issue はまだ評価されていません。
説明
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)
- 主要言語
- Python
- スター
- 495
- フォーク
- 358
- 平均マージ
- 16時間 54分
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
langfuse/langfuse-python のほかの issue
-
bug: get_dataset_run / get_dataset_runs / delete_dataset_run are unusable on Langfuse v4対応中かも @hassiebp が 10 日前に担当しました。 オープンbug feat-datasets feat-experiments sdk-python
langfuse/langfuse-python#1906 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
mask is not applied to create_dataset_item or create_score(comment=)対応中かも @hassiebp が 14 日前に担当しました。 オープンbug compliance feat-data-masking sdk-python security
langfuse/langfuse-python#1896 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Scores bypass sample_rate since v4対応中かも @hassiebp が 19 日前に担当しました。 オープンfeat-scores sdk-python unconfirmed-bug
langfuse/langfuse-python#1890 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
batch_evaluation fails on self-hosted v4 events_only deployments (uses unavailable v3 read endpoints)再び着手できるかも @hassiebp が 32 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug feat-evals sdk-python
langfuse/langfuse-python#1861 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)再び着手できるかも @hassiebp が 33 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンimprovement sdk-python
langfuse/langfuse-python#1856 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
langfuse/langfuse-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
war-and-code/dircue#200 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信