system_mixin.set_hostname() rewrites /etc/hosts as root with echo <b64> | base64 -d > /tmp/_netork_hosts && mv /tmp/_netork_hosts /etc/hosts && chmod 644 /etc/hosts. The name in /tmp is fixed and world-writable territory: a local user can create /tmp/_netork_hosts (or a symlink there) beforehand. The redirection then writes into the user's file, and mv puts a file the user owns at /etc/hosts, which the user can rewrite afterwards (or the symlink sends root's write elsewhere).
Fix: write into a mktemp file created next to the target (/etc/.hosts.XXXXXX, root-only directory, same filesystem), chmod 644, then mv over /etc/hosts; remove the temporary file if a step fails.
Prio: P3
Found in netOrk's security sweep of 2026-11-12 (NetOrk/netork#2446).
`system_mixin.set_hostname()` rewrites `/etc/hosts` as root with `echo <b64> | base64 -d > /tmp/_netork_hosts && mv /tmp/_netork_hosts /etc/hosts && chmod 644 /etc/hosts`. The name in `/tmp` is fixed and world-writable territory: a local user can create `/tmp/_netork_hosts` (or a symlink there) beforehand. The redirection then writes into the user's file, and `mv` puts a file the user owns at `/etc/hosts`, which the user can rewrite afterwards (or the symlink sends root's write elsewhere).
**Fix:** write into a `mktemp` file created next to the target (`/etc/.hosts.XXXXXX`, root-only directory, same filesystem), `chmod 644`, then `mv` over `/etc/hosts`; remove the temporary file if a step fails.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Prio: P3
Found in netOrk's security sweep of 2026-11-12 (NetOrk/netork#2446).
system_mixin.set_hostname()rewrites/etc/hostsas root withecho <b64> | base64 -d > /tmp/_netork_hosts && mv /tmp/_netork_hosts /etc/hosts && chmod 644 /etc/hosts. The name in/tmpis fixed and world-writable territory: a local user can create/tmp/_netork_hosts(or a symlink there) beforehand. The redirection then writes into the user's file, andmvputs a file the user owns at/etc/hosts, which the user can rewrite afterwards (or the symlink sends root's write elsewhere).Fix: write into a
mktempfile created next to the target (/etc/.hosts.XXXXXX, root-only directory, same filesystem),chmod 644, thenmvover/etc/hosts; remove the temporary file if a step fails.