Package: arpwatch Version: 2.1a15-11 Severity: important Tags: security X-Debbugs-CC: [email protected]
Hi, A process running as the arpwatch user gets root on a machine with an enabled arpwatch@<interface> instance. The arpwatch daemon runs as that user while it parses traffic from the local network, so a bug in the daemon (for example #1137278) leads to root through this one. [email protected] has no User= line, so its ExecStartPre lines run as root, and they run "chown $RUNAS %i.dat" inside /var/lib/arpwatch, which is owned by arpwatch. chown follows symlinks, and fs.protected_symlinks does not apply because the directory is not sticky. The arpwatch user replaces its data file with a symlink to a root-owned file and makes its own daemon exit. Restart=on-failure runs the ExecStartPre lines again and root chowns the symlink target to arpwatch. We reproduced it on 2026-11-28 with arpwatch 2.1a15-8+b1 on Debian 12, 2.1a15-9 on Debian 13 and 2.1a15-8.1build2 on Ubuntu 24.04. Unstable 2.1a15-11 ships the same unit lines. The shipped /etc/default/arpwatch has INTERFACES="", so an admin has to enable an instance. Fix: create the data file as the service user and drop the root chown. This drop-in stopped it on all three releases (the restart fails on the symlink instead of following it): ExecStartPre= ExecStartPre=/usr/sbin/runuser -u ${RUNAS} -- /usr/bin/touch -a %i.dat Thanks, ozgun kultekin, wakefield (wakefield.co)

