T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:47
- Finding
- Backup Script Collects Data Beyond the Minimum Required Scope## Vulnerability Details **File Location**: `SKILL.md`, lines 47-52 **Vulnerability Type**: Overbroad access to local files and system configuration **Risk Level**: Medium **Vulnerable Code**: ```bash # Backup home directory rsync -avh --delete \ --exclude='.cache' \ --exclude='node_modules' \ --exclude='.local/share/Trash' \ --exclude='*.tmp' \ /home/ $BACKUP_DIR/home/ 2>&1 >> $LOG # Backup system configs rsync -avh /etc/ $BACKUP_DIR/etc/ 2>&1 >> $LOG ``` ### Technical Analysis The generated backup script copies all readable content under `/home/` and `/etc/`. This is broader than the minimum scope needed to back up the requesting user's files. Depending on the account executing the script, these locations can include other users' documents, SSH keys, application credentials, network configurations, password hashes readable by the executing account, service credentials, and other security-sensitive configuration. Copying these files to an external drive, NAS, or other destination creates an additional repository of sensitive information whose access controls may be weaker than those of the source system. No privilege-escalation command is present, and the script cannot read files beyond the executing account's existing permissions. The security issue is that it exercises all available read access rather than restricting collection to paths necessary for the requested backup. ### Attack Path 1. A user asks the agent to create or schedule a backup. 2. The agent creates the documented script and retains `/home/` and `/etc/` as source paths. 3. The script runs manually or through cron with the invoking account's permissions. 4. Every readable file in those source trees is copied to the configured backup destination. 5. A local user, remote storage operator, or attacker who compromises the backup destination accesses sensitive files that were not necessary for the requeste ...[truncated 457 chars]
- Remediation
- ## Remediation Suggestions - Default to the requesting user's directory, such as `/home/USER/`, instead of all of `/home/`. - Require explicit confirmation before adding `/etc/`, another user's home directory, or any system-wide source. - Use an allowlist of user-selected source directories. - Exclude sensitive credential stores unless the user explicitly requests and understands their inclusion. - Ensure the destination and backup files use restrictive ownership and permissions. - Encrypt backups stored on removable, network, or cloud destinations. - Display the resolved source paths, destination, exclusions, and execution identity before the first backup. - Avoid recommending privileged execution unless a specifically requested source requires it.
