Bug 1662867 (CVE-2018-16888) - CVE-2018-16888 systemd: kills privileged process if unprivileged PIDFile was tampered
Summary: CVE-2018-16888 systemd: kills privileged process if unprivileged PIDFile was ...
Status: NEW
Alias: CVE-2018-16888
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=low,public=20170817,reported=2...
Keywords: Security
Depends On: 1663143
Blocks: 1662883
TreeView+ depends on / blocked
 
Reported: 2019-01-02 09:38 UTC by Riccardo Schirone
Modified: 2019-06-08 23:47 UTC (History)
3 users (show)

(edit)
It was discovered systemd does not correctly check the content of PIDFile files before using it to kill processes. When a service is run from an unprivileged user (e.g. User field set in the service file), a local attacker who is able to write to the PIDFile of the mentioned service may use this flaw to trick systemd into killing other services and/or privileged processes.
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)

Description Riccardo Schirone 2019-01-02 09:38:37 UTC
systemd up to version 237 does not perform any check on the content of the PIDFile file of a service, which may result in systemd killing a process owned by other services when the service the PIDFile belongs to is stopped. In case the PIDFile is owned by unprivileged users (e.g. a service run with a different User field), systemd may kill privileged processes. A local attacker who is able to tamper with the PIDFile of a service may trick systemd into killing processes he would not have permissions to kill, in the moment a privileged user tries to kill the mentioned service.

Upstream patches:
https://github.com/systemd/systemd/pull/7816

Upstream issue:
https://github.com/systemd/systemd/issues/6632

Comment 5 Riccardo Schirone 2019-01-03 10:09:52 UTC
When PIDFile is specified, systemd uses the content of the file to find out the pid of the main process of a service. A vulnerable/malicious service (or one executed by unprivileged user with the User/Group fields) may allow non-root users to write into this file, tricking systemd into killing the wrong process. This is particularly important when services are run by unprivileged users, because systemd kills the process with root permission, even if the service was started by a different user (e.g. User=unprivileged-user) and can be used by a local attacker to cause a Denial of Service.


Note You need to log in before you can comment on or make changes to this bug.