memory-backup
Warn
Audited by Gen Agent Trust Hub on Jul 4, 2026
Risk Level: MEDIUMCOMMAND_EXECUTION
Full Analysis
- [COMMAND_EXECUTION]: The Python scripts
backup.pyandrestore.pyimplement a common helper functionrun()that executes system commands usingsubprocess.run(shell=True). This execution mode is inherently risky as it invokes a shell environment for command processing. - [COMMAND_EXECUTION]: Command strings are constructed using f-strings that incorporate variables derived from script arguments without any shell escaping. For example, in
scripts/backup.py, thecommit_msg(from the--messageflag) is directly placed into a git command:run(f'git commit -m "{commit_msg}"', cwd=backup_dir). An attacker providing a message like"; touch /tmp/pwn; #could execute arbitrary code. - [COMMAND_EXECUTION]: Similar injection patterns exist in
scripts/backup.pyfor the repository name duringgh repo viewandgh repo createoperations, and inscripts/restore.pywhere the repository name influences thegit clonecommand parameters. - [COMMAND_EXECUTION]: The reliance on string interpolation for shell commands instead of passing arguments as a list to
subprocess.runcreates a significant attack surface if the agent is tricked into passing malicious strings via prompt injection.
Audit Metadata