headscale-backup

Warn

Audited by Gen Agent Trust Hub on Sep 3, 2026

Risk Level: MEDIUMREMOTE_CODE_EXECUTIONCOMMAND_EXECUTIONDATA_EXFILTRATIONPRIVILEGE_ESCALATIONINDIRECT_PROMPT_INJECTIONDYNAMIC_EXECUTION
Full Analysis
  • [DATA_EXFILTRATION]: The hs-migrate.sh script facilitates the transmission of sensitive data, including TLS private keys (server.key), node private keys (private.key), and the SQLite database containing node state and API key hashes, to external hosts using rsync.
  • [REMOTE_CODE_EXECUTION]: The migration process involves executing commands and scripts on remote target hosts via ssh, including the use of bash -s to execute dynamically generated code blocks.
  • [PRIVILEGE_ESCALATION]: The hs-restore.sh script relies on sudo to overwrite critical system configuration files in /etc/headscale/ and database files in /var/lib/headscale/, as well as to stop and start system services.
  • [DYNAMIC_EXECUTION]: The hs-migrate.sh script dynamically constructs a multi-line bash script at runtime and pipes it to a remote shell for execution on the target host.
  • [COMMAND_EXECUTION]: The scripts invoke several shell utilities such as tar, rsync, ssh, and pkill to perform system-level operations across local and remote environments.
  • [INDIRECT_PROMPT_INJECTION]: The skill processes external backup archives which represents a potential vulnerability surface if malicious archives are supplied.
  • Ingestion points: Backup tarball path passed to the restore script.
  • Boundary markers: The script performs basic gzip integrity checks and verifies the presence of internal files like db.sqlite and config.yaml.
  • Capability inventory: The skill has capabilities to modify the file system with root privileges and manage system services via sudo.
  • Sanitization: There is no cryptographic signature verification or source authentication performed on the backup archives prior to restoration.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Sep 3, 2026, 02:38 AM
Security Audit — agent-trust-hub — headscale-backup