Summary
A path traversal flaw in assisted-migration-agent allows an attacker on the same LAN to craft a malicious gzipped tarball that bypasses directory security checks and writes files to arbitrary locations on the appliance.
If successfully exploited, this uncontrolled file write can be leveraged to execute unauthorized code and gain high-impact control over the affected system.
Affected context
The vulnerability occurs in environments where assisted-migration-agent processes gzipped tarballs received over a network or migration interface.
It is relevant when:
- The agent automatically accepts or processes tarball-based input from the local network.
- The extraction logic does not fully normalize or validate file paths contained in the archive.
- The target system has locations where dropped files can influence execution (e.g., scripts, configuration, or service binaries).
These conditions can be present in appliances or migration tooling that prioritize automation and convenience over strict path handling.
Exploit preconditions
- Attack surface: Network-accessible assisted-migration-agent service on the local area network.
- Required access: No authentication; the attacker must only be able to reach the service from the same LAN segment or allowed network zone.
- Trigger point: Submission or delivery of a specially crafted gzipped tarball that the agent processes.
- Why exploitation is possible: The archive extraction logic fails to safely handle path components such as
../or absolute paths in tar entries, allowing files from the archive to be written outside the intended directory, bypassing directory and security checks.
Why this happens
The core issue aligns with CWE-59: Improper Link Resolution Before File Access and CWE-22: Path Traversal, where user-controlled path data from an archive is used directly in filesystem operations without robust canonicalization and enforcement of an allowed root directory.
Assisted-migration-agent trusts file names and paths within the gzipped tarball and uses them to create or overwrite files without consistently stripping dangerous components, resolving symbolic links safely, or verifying that the final resolved path remains within a designated safe directory.
This pattern turns what should be constrained data import into an arbitrary file write primitive, which attackers can chain into code execution by targeting paths that are executed or interpreted by the system.
Potential impact
- Attacker-crafted files may be written outside the intended extraction directory.
- System or application configuration files could be overwritten, altering security settings.
- Executable scripts or binaries can be planted or replaced to run attacker-controlled code.
- Service startup scripts or cron jobs may be modified to persist malicious behavior.
- Sensitive application data or logs could be corrupted, deleted, or replaced.
- The appliance may be fully compromised, allowing lateral movement within the network.
General mitigation guidance
Effective mitigation focuses on confining file operations and distrusting archive metadata:
- Enforce strict path normalization for all archive entries and explicitly reject any paths containing
.., absolute paths, or drive/root prefixes. - Resolve symbolic links in a controlled manner and ensure that the final canonical path always resides under a predetermined, immutable base directory.
- Use high-level archive extraction APIs or helper routines that implement safe extraction semantics instead of rolling custom path handling.
- Run the assisted-migration-agent under a minimal-privilege account with restricted filesystem permissions, so even if a write escapes the intended directory, impact is limited.
- Treat migration input as untrusted by default: apply content validation, size limits, and strong authentication/authorization around the service where feasible.
How teams detect issues like this
Detection can combine code-level inspection and runtime monitoring:
- Static analysis rules can flag uses of archive extraction routines where entry names are concatenated directly into filesystem paths without normalization or base-path enforcement.
- Code review should look for tar/gzip extraction loops that do not explicitly validate paths, check for
..segments, or verify canonical paths against a single allowed directory. - Security test suites and fuzzers can include malicious tarballs with nested directories, symbolic links, absolute paths, and long path chains to identify unsafe extraction behavior.
- Runtime monitoring and file integrity checks on critical directories can help detect unexpected writes or modifications originating from the migration agent process.

