run_command(privileged=True, stdin=data) sent sudo -S with stdin = <sudo password>\n + data. A sudo that does not prompt (NOPASSWD, a cached timestamp) leaves the password line on stdin. The command then reads it as the first line of the data, and cat > file writes it into the file. This happened on 2026-10-11 with the SSH fix (NetOrk/netork#1027) and is tracked in NetOrk/netork#1029.
Change
run_command raises ValueError for privileged + stdin while a sudo password is set, before any channel opens.
Stdin still reaches the command under sudo -n (no password), for a root login, and for unprivileged commands.
open_stream documents the same caveat.
Callers checked: no caller in netOrk or the other drivers combines privileged + stdin after NetOrk/netork#1029. That PR converts write_compose_file to staging. napalm-device-types' SSH fix already stages. napalm-bsd has its own run_command and the same bug: NAPALM/napalm-bsd#8.
Tests:test_stdin_follows_the_sudo_password, which pinned the old behaviour, is replaced by four tests: refused with a password, allowed without one, allowed as root, unprivileged stdin allowed. Full suite: 141 passed.
After merge: re-pin vendor-drivers.txt in netOrk to the merge commit (in the NetOrk/netork#1029 PR).
`run_command(privileged=True, stdin=data)` sent `sudo -S` with stdin = `<sudo password>\n` + data. A sudo that does not prompt (NOPASSWD, a cached timestamp) leaves the password line on stdin. The command then reads it as the first line of the data, and `cat > file` writes it into the file. This happened on 2026-10-11 with the SSH fix (NetOrk/netork#1027) and is tracked in NetOrk/netork#1029.
**Change**
- `run_command` raises `ValueError` for privileged + stdin while a sudo password is set, before any channel opens.
- Stdin still reaches the command under `sudo -n` (no password), for a root login, and for unprivileged commands.
- `open_stream` documents the same caveat.
**Callers checked:** no caller in netOrk or the other drivers combines privileged + stdin after NetOrk/netork#1029. That PR converts `write_compose_file` to staging. napalm-device-types' SSH fix already stages. napalm-bsd has its own `run_command` and the same bug: NAPALM/napalm-bsd#8.
**Tests:** `test_stdin_follows_the_sudo_password`, which pinned the old behaviour, is replaced by four tests: refused with a password, allowed without one, allowed as root, unprivileged stdin allowed. Full suite: 141 passed.
After merge: re-pin `vendor-drivers.txt` in netOrk to the merge commit (in the NetOrk/netork#1029 PR).
run_command(privileged=True, stdin=data) sent `sudo -S` with stdin =
<sudo password>\n + data. A sudo that does not prompt (NOPASSWD, a cached
timestamp) leaves the password line on stdin, and the command reads it as
the first line of the data - `cat > file` wrote it into the file
(NetOrk/netork#1029).
run_command now raises ValueError for that combination before opening a
channel. Stdin still reaches the command under `sudo -n` (no password set),
for a root login, and for unprivileged commands. Callers stage the data
without privilege and have root install the file. open_stream documents the
same caveat.
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.
run_command(privileged=True, stdin=data)sentsudo -Swith stdin =<sudo password>\n+ data. A sudo that does not prompt (NOPASSWD, a cached timestamp) leaves the password line on stdin. The command then reads it as the first line of the data, andcat > filewrites it into the file. This happened on 2026-10-11 with the SSH fix (NetOrk/netork#1027) and is tracked in NetOrk/netork#1029.Change
run_commandraisesValueErrorfor privileged + stdin while a sudo password is set, before any channel opens.sudo -n(no password), for a root login, and for unprivileged commands.open_streamdocuments the same caveat.Callers checked: no caller in netOrk or the other drivers combines privileged + stdin after NetOrk/netork#1029. That PR converts
write_compose_fileto staging. napalm-device-types' SSH fix already stages. napalm-bsd has its ownrun_commandand the same bug: NAPALM/napalm-bsd#8.Tests:
test_stdin_follows_the_sudo_password, which pinned the old behaviour, is replaced by four tests: refused with a password, allowed without one, allowed as root, unprivileged stdin allowed. Full suite: 141 passed.After merge: re-pin
vendor-drivers.txtin netOrk to the merge commit (in the NetOrk/netork#1029 PR).