bug: GCS upload detection in MediaManager uses substring match on the full URL
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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)
- Vorherrschende Sprache
- Python
- Sterne
- 498
- Forks
- 361
- Ø Merge
- 16 Std. 58 Min.
- Gemergte PRs (30 T.)
- 32
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus langfuse/langfuse-python
-
bug: get_dataset_run / get_dataset_runs / delete_dataset_run are unusable on Langfuse v4Evtl. vergeben @hassiebp hat das vor 12 Tagen übernommen. Offenbug feat-datasets feat-experiments sdk-python
langfuse/langfuse-python#1906 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
mask is not applied to create_dataset_item or create_score(comment=)Evtl. vergeben @hassiebp hat das vor 16 Tagen übernommen. Offenbug compliance feat-data-masking sdk-python security
langfuse/langfuse-python#1896 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Scores bypass sample_rate since v4Evtl. vergeben @hassiebp hat das vor 21 Tagen übernommen. Offenfeat-scores sdk-python unconfirmed-bug
langfuse/langfuse-python#1890 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
batch_evaluation fails on self-hosted v4 events_only deployments (uses unavailable v3 read endpoints)Evtl. vergeben @hassiebp hat das vor 34 Tagen übernommen. Offenbug feat-evals sdk-python
langfuse/langfuse-python#1861 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)Evtl. vergeben @hassiebp hat das vor 35 Tagen übernommen. Offenimprovement sdk-python
langfuse/langfuse-python#1856 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in langfuse/langfuse-python
Ähnliche Issues
-
HTML: <template> content is extracted as document textEvtl. vergeben @ryanmeowy hat das heute übernommen. Offenbug html
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
docling-project/docling#4714 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] Qdrant RAG client applies score_threshold to raw cosine similarity, not the 0-1 score it returnsEvtl. vergeben @roydonsequeira hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
Host test failure in core/direct_io.zig on Linux kernel 6.17: O_DIRECT open succeeds on procfs, so the test's 'plain' fd is not plainEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ashhart/TensorFold#536 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/install-update comp/cli duplicate P2 python:uv sweeper:risk-compatibility type/bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
NousResearch/hermes-agent#135440 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Deepak3699/Ai_Mentor#244 ·
Maintainer antworten meist innerhalb von 1 Tag