posted 2017-11-23
The icinga2 init script
(etc/initsystem/icinga2.init.d.cmake) and
systemd service file
(etc/initsystem/icinga2.service.cmake) allow
the unprivileged $ICINGA2_USER
to gain root privileges
by replacing the target of chown with a
link.
The full details, exploit, and mitigation for this class of vulnerabilities are discussed in my article, End root chowning now (make /etc/init.d great again).
Unique to this case is that the bug is located outside of the init script, in prepare-dirs, and that it (therefore) affects the systemd service file as well:
user $ grep prepare-dirs etc/initsystem/icinga2.init.d.cmake
@CMAKE_INSTALL_PREFIX@/lib/icinga2/prepare-dirs $SYSCONFIGFILE
user $ grep prepare-dirs etc/initsystem/icinga2.service.cmake
ExecStartPre=@CMAKE_INSTALL_PREFIX@/lib/icinga2/prepare-dirs @ICINGA2_SYSCONFIGFILE@