Summary
Flyto2 Core prior to 2.26.6 allows caller-controlled output directories to be used by image.download and related file-writing modules without sandbox validation.
If an attacker can influence workflow configuration or AI-agent outputs, they can cause arbitrary response bytes to be written to filesystem paths accessible to the process, enabling data corruption, configuration tampering, or further compromise.
Flyto2 Core prior to 2.26.6 allows caller-controlled output directories to be used by image.download and related file-writing modules without sandbox validation.
If an attacker can influence workflow configuration or AI-agent outputs, they can cause arbitrary response bytes to be written to filesystem paths accessible to the process, enabling data corruption, configuration tampering, or further compromise.
Affected context
This vulnerability occurs in Flyto2 Core automation and AI-agent workflows where:
- The
image.downloadmodule and similar file-writing components accept a caller-providedoutput_dir - Path validation and confinement via
validate_path_with_env_configandFLYTO_SANDBOX_DIRare not enforced - Workflows or agents can be driven by user-controlled or externally sourced parameters
Deployments that run Flyto2 Core with broad filesystem access or elevated privileges are more exposed, but even restricted environments can see unauthorized file modification.
This vulnerability occurs in Flyto2 Core automation and AI-agent workflows where:
- The
image.downloadmodule and similar file-writing components accept a caller-providedoutput_dir - Path validation and confinement via
validate_path_with_env_configandFLYTO_SANDBOX_DIRare not enforced - Workflows or agents can be driven by user-controlled or externally sourced parameters
Deployments that run Flyto2 Core with broad filesystem access or elevated privileges are more exposed, but even restricted environments can see unauthorized file modification.
Exploit preconditions
- Attack surface: Workflow configuration, task parameters, or AI-agent instructions that influence
output_dirand download targets. - Required access: Ability to define or modify automation workflows, agent prompts, or API calls that invoke
image.downloador similar modules. - Trigger point: Execution of a workflow step that downloads content and writes it to a filesystem path derived from attacker-controlled
output_dir. - Why exploitation is possible: The code trusts caller-supplied paths instead of enforcing sandbox confinement via
validate_path_with_env_configandFLYTO_SANDBOX_DIR, enabling path traversal or direct selection of sensitive locations.
- Attack surface: Workflow configuration, task parameters, or AI-agent instructions that influence
output_dirand download targets. - Required access: Ability to define or modify automation workflows, agent prompts, or API calls that invoke
image.downloador similar modules. - Trigger point: Execution of a workflow step that downloads content and writes it to a filesystem path derived from attacker-controlled
output_dir. - Why exploitation is possible: The code trusts caller-supplied paths instead of enforcing sandbox confinement via
validate_path_with_env_configandFLYTO_SANDBOX_DIR, enabling path traversal or direct selection of sensitive locations.
Why this happens
The underlying bug class aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-73: External Control of File Name or Path.
File-writing modules treat the output_dir parameter as trustworthy, constructing filesystem paths without validating that they remain within a confined sandbox directory.
This insecure pattern allows external inputs to control where downloaded bytes are written, breaking directory confinement and enabling arbitrary file writes in any location the process can access.
The underlying bug class aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-73: External Control of File Name or Path.
File-writing modules treat the output_dir parameter as trustworthy, constructing filesystem paths without validating that they remain within a confined sandbox directory.
This insecure pattern allows external inputs to control where downloaded bytes are written, breaking directory confinement and enabling arbitrary file writes in any location the process can access.
Potential impact
- Attackers may write arbitrary data to configuration files or logs, potentially altering application behavior.
- Attackers could overwrite or corrupt critical workflow artifacts, models, or data assets.
- Attackers can plant or modify scripts, templates, or other executable content the automation platform later runs.
- Attackers may be able to pivot to remote code execution if written files are interpreted or executed by other components.
- Attackers could exfiltrate or poison data by manipulating where sensitive information is stored or read.
- Attackers may write arbitrary data to configuration files or logs, potentially altering application behavior.
- Attackers could overwrite or corrupt critical workflow artifacts, models, or data assets.
- Attackers can plant or modify scripts, templates, or other executable content the automation platform later runs.
- Attackers may be able to pivot to remote code execution if written files are interpreted or executed by other components.
- Attackers could exfiltrate or poison data by manipulating where sensitive information is stored or read.
General mitigation guidance
Effective mitigation centers on strict path confinement and reducing trust in caller-controlled file locations:
- Ensure all file-writing paths are derived through a validated sandbox function that enforces a fixed base directory and rejects traversal outside it.
- Treat workflow parameters, agent outputs, and API inputs as untrusted, normalizing and validating any path-like values before using them.
- Apply least-privilege to the Flyto2 Core runtime so that it has access only to directories required for operation, limiting impact even if a write escapes the sandbox.
- Use deny-by-default policies for sensitive filesystem locations (configuration, binaries, secrets) and avoid tying workflow behavior to file contents in unrestricted paths.
- Design automation steps so that downloaded content is stored in isolated, non-executable directories, reducing the risk of code execution from written files.
Effective mitigation centers on strict path confinement and reducing trust in caller-controlled file locations:
- Ensure all file-writing paths are derived through a validated sandbox function that enforces a fixed base directory and rejects traversal outside it.
- Treat workflow parameters, agent outputs, and API inputs as untrusted, normalizing and validating any path-like values before using them.
- Apply least-privilege to the Flyto2 Core runtime so that it has access only to directories required for operation, limiting impact even if a write escapes the sandbox.
- Use deny-by-default policies for sensitive filesystem locations (configuration, binaries, secrets) and avoid tying workflow behavior to file contents in unrestricted paths.
- Design automation steps so that downloaded content is stored in isolated, non-executable directories, reducing the risk of code execution from written files.
How teams detect issues like this
Organizations can identify this class of vulnerability through:
- Static analysis patterns that flag uses of caller-controlled path parameters in file-write APIs without preceding sandbox or validation routines.
- Code review checklists that require verification of path normalization, restriction to approved base directories, and explicit rejection of traversal sequences like
../. - Runtime monitoring to detect unusual writes to sensitive directories (e.g., configuration, binaries, or model repositories) originating from workflow or agent modules.
- Policy enforcement that prevents deployment of workflows or agents that specify arbitrary filesystem paths or override sandbox settings.
- Periodic security audits focusing on components that handle downloads, file generation, and artifact storage, ensuring they follow consistent confinement patterns.
Organizations can identify this class of vulnerability through:
- Static analysis patterns that flag uses of caller-controlled path parameters in file-write APIs without preceding sandbox or validation routines.
- Code review checklists that require verification of path normalization, restriction to approved base directories, and explicit rejection of traversal sequences like
../. - Runtime monitoring to detect unusual writes to sensitive directories (e.g., configuration, binaries, or model repositories) originating from workflow or agent modules.
- Policy enforcement that prevents deployment of workflows or agents that specify arbitrary filesystem paths or override sandbox settings.
- Periodic security audits focusing on components that handle downloads, file generation, and artifact storage, ensuring they follow consistent confinement patterns.

