CVE-2026-71284 in Fledge
Summary
by MITRE • 08/05/2026
Fledge's backup-restore upload handler, upload_backup() (python/fledge/services/core/api/backup_restore.py), takes the first extracted tar member's filename (tar_file_names[0]) and builds a shell command via string formatting: `cmd = "cp {} {}".format(source, backup_path); ret_code = os.system(cmd)`. The only pre-check on the filename is a prefix/suffix match (startswith(backup_prefix), endswith(valid_extensions)), which a name such as `fledge_backup_$(id>/tmp/pwn).db` satisfies while still injecting a shell command substitution. Because os.system() invokes a shell and no quoting (shlex.quote, list-form subprocess) is applied, an admin uploading a crafted backup archive achieves arbitrary OS command execution.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 08/05/2026
The vulnerability exists within Fledge's backup-restore functionality where the upload_backup() handler in python/fledge/services/core/api/backup_restore.py demonstrates a critical command injection flaw. This vulnerability stems from improper input validation and unsafe shell command construction when processing uploaded backup archives. The system extracts the first tar member's filename using tar_file_names[0] and directly incorporates it into a shell command through string formatting without adequate sanitization or escaping mechanisms.
The technical flaw manifests in how the application handles user-supplied filenames during backup restoration operations. While the code implements basic validation checks using startswith() and endswith() methods to verify the filename prefix and suffix against allowed patterns, this approach proves insufficient for preventing command injection attacks. An attacker can craft a malicious filename such as fledge_backup_$(id>/tmp/pwn).db that passes these superficial checks while simultaneously embedding shell command substitution syntax within the archive name. The vulnerability occurs because the system treats the extracted filename as trusted input and directly concatenates it into a shell command string without proper shell escaping or parameterization.
The operational impact of this vulnerability is severe, as it allows an authenticated administrator with backup upload privileges to achieve arbitrary operating system command execution on the host system. This represents a critical privilege escalation vector that transforms a legitimate administrative function into a potential attack surface for remote code execution. The attacker can execute any shell command with the privileges of the Fledge service account, potentially leading to full system compromise, data exfiltration, or persistence mechanisms establishment. The vulnerability affects all versions of Fledge where this specific backup handler remains active and accessible.
This vulnerability maps directly to CWE-78, which specifically addresses OS Command Injection, and aligns with ATT&CK technique T1059.004 for command and scripting interpreter. The attack vector leverages the principle of insufficient input validation combined with unsafe shell invocation patterns. Mitigation strategies should include implementing proper shell escaping using shlex.quote() or adopting subprocess with list-form arguments instead of os.system(). Additionally, the application should validate filenames against comprehensive regex patterns that prevent shell metacharacter injection and implement strict file name sanitization processes before any command construction occurs. The code should also enforce principle of least privilege by limiting backup upload capabilities to only essential administrative users and implementing proper input validation at multiple layers of the application stack.
The vulnerability demonstrates a classic example of unsafe string formatting in security-sensitive contexts where user-controlled data enters shell execution paths without appropriate sanitization or escaping mechanisms. This flaw represents a fundamental breakdown in secure coding practices that should be addressed through comprehensive code review processes and adherence to secure programming guidelines for shell command construction in enterprise applications.