bug: GCS upload detection in MediaManager uses substring match on the full URL
Les mainteneurs répondent en général sous 1 jour
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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)
- Langage dominant
- Python
- Étoiles
- 502
- Forks
- 381
- Merge moyen
- 1 j 1 h
- PR mergées (30 j)
- 64
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de langfuse/langfuse-python
-
bug(scores): create_score sends numpy.bool_ as JSON `true` and Decimal as "<Decimal>" since v5.0.2Peut-être pris @lalith0407 l’a pris il y a 3 jours. Ouvertebug feat-scores sdk-python
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
langfuse/langfuse-python#2057 ·
Les mainteneurs répondent en général sous 1 jour
-
tests/unit/test_prompt.py fails on a fresh clone without LANGFUSE_* env varsPeut-être pris @Mathoholic l’a pris il y a 17 jours. Ouvertebug feat-prompt-management sdk-python
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
langfuse/langfuse-python#1976 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
bug(openai): a stream that fails mid-iteration ends the generation without level ERRORPeut-être pris @hassiebp l’a pris il y a 6 jours. Ouvertebug integration-openai sdk-python
langfuse/langfuse-python#2039 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
fix(serializer): handle single-string __slots__ and detect cycles in slotted objectsPeut-être pris @hassiebp l’a pris il y a 12 jours. Ouvertebug sdk-python
langfuse/langfuse-python#2014 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
bug: ChatPromptClient.compile appends str(whole list) once per non-dict placeholder itemPeut-être pris @nimarb l’a pris il y a 7 jours. Ouvertebug feat-prompt-management sdk-python
langfuse/langfuse-python#1971 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de langfuse/langfuse-python
Issues similaires
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
glossyio/traffic-monitor#264 ·
Les mainteneurs répondent en général sous 1 jour
-
Add self-hostOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
Atarity/deploy-your-own-saas#102 ·
-
[Bug]: RDFlex silently drops the covariate adjustment when the outcome or treatment column is integer-typedPeut-être pris @vrjdev l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
DoubleML/doubleml-for-py#424 ·
Les mainteneurs répondent en général sous 1 jour
-
agentic-dmx docs enhancement
Difficulté 1/5 1-3 heures Accessibilité débutants 86/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
521xueweihan/HelloGitHub#4150 ·