GHSA-98hr-q8q8-5j23: Rootless privilege escalation
- Published:
- Fetched:
- Updated:
- Affects:
- louislam Rootless Docker Image only
https://github.com/louislam/uptime-kuma/security/advisories/GHSA-98hr-q8q8-5j23 ↗
Rootless privilege escalation ### Summary Using the rootless containers, it is trivially easy to get root; this negates most of the security benefits and importantly misleads the user into thinking that rootless is safe which might lead to them securing it less / giving it more access to things under the bad assumption that it is safe. ### Details This is caused by: 1. Rootless containers allow the node user to run `sudo` for a few commands 2. In /etc/sudoers, the commands allowed do not restrict their arguments or anything, allowing for arbitrary usage of them 3. `service`, permitted by sudo without a password, allows arbitrary code execution due to path traversal A possible quick fix for this would be only allowing sudo to run `service` with specific arguments rather than arbitrary invocations of it. ### Proof of concept Start running `louislam/uptime-kuma:next-rootless` as a docker container named `uptime`. Then: ```bash $ docker exec -it uptime sudo /usr/sbin/service ../../bin/sh ``` ### Impact Anyone running rootless can be rooted, this negates the security benefits of rootless, and can be extra dangerous if users were extra-permissive with uptime kuma's permissions specifically because it was rootless Affected packages: :Rootless Docker Image only Patched: Rootless Docker Image only 2.5.6