CWE-22 · CWE-59 · CWE-367
This is a Local Privilege Escalation (LPE) vulnerability stemming from improper symlink handling (CWE-59: Link Following) and improper ownership management (CWE-282) inside the qbee-agent file manager logic. ### Impact Any managed device running qbee-agent up to the affected versions. The impact manifests in three distinct vectors: 1. **Primary Vector (Full Privilege Escalation to Root - Default Configuration)**: If an unprivileged user's account is managed by the SSH Keys bundle, they can replace or remove their own `~/.ssh` directory and create a symlink pointing to `/root/.ssh`. On the next configuration apply, qbee-agent follows the symlink and writes the user's server-provisioned public key directly into `/root/.ssh/authorized_keys`. Since the symlink resides inside the user's own home directory, kernel protections like `fs.protected_symlinks` do not block this execution. The attacker can then instantly log in as root via SSH. 2. **Secondary Vector (Arbitrary File Overwrite / DoS via RAUC Staging)**: On devices utilizing RAUC download mode, the agent uses a predictable, world-writable staging path (`/tmp/.bundle.raucb.part`). If `fs.protected_symlinks` is disabled `(0)`, an unprivileged user can symlink this path to a vital system file (e.g., `/etc/shadow` or `/etc/pam.d/*`), causing the agent to truncate or overwrite it with server-supplied update data during a RAUC update deployment. 3. **Tertiary Vector (Arbitrary File Re-ownership via File Distribution)**: If an