T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:19- Finding
Recovery instructions grant unnecessary write access to the raw target device
- Content
View full analysis
&& sudo chmod 660 `); do not use `sudo mount`. ``` The same recommendation is presented to users by `scripts/diag.sh:18-22`: ```bash if [ ! -r "$DEV" ]; then echo "!! No permission to read $DEV. Run as root, or execute:" echo " sudo chown \$USER:disk $DEV && sudo chmod 660 $DEV" exit 1 fi ``` It is also repeated in `references/tool-limits.md:78`: ```markdown 2. Is the device readable? → No: sudo chown $USER:disk ``` ### Technical Analysis The documented `chmod 660` operation grants both read and write access to the device owner and group. Changing the device owner to the interactive user additionally gives every process running under that account direct write access to the raw block device. This contradicts the project's stated read-only recovery model. Raw block-device write access is not necessary for the diagnostic or recovery scripts: both Python code and `diag.sh` only require read access. A mistaken shell command, compromised user process, parser defect, or unrelated application running under the same account could consequently write directly to filesystem metadata and data blocks. The permission change can also persist until the device node is recreated or its ownership and mode are manually restored. ### Attack Path 1. A user cannot initially read the recovery device. 2. The user follows the supplied instruction and runs: ```bash sudo chown "$USER":disk /dev/sdb1 sudo chmod 660 /dev/sdb1 ``` 3. The interactive user and members of the `disk` grou ...[truncated 967 chars]- Remediation
View remediation
&2 exit 1 fi ``` 5. Preserve and restore the original ownership, mode, and ACLs if the workflow modifies device permissions. 6. Apply the corrected guidance consistently in `SKILL.md`, `scripts/diag.sh`, and `references/tool-limits.md`. ]]>
