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 ...
Alias: CVE-2018-16888
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1663143 1786119 1786120 1786121
Blocks: 1662883
TreeView+ depends on / blocked
Reported: 2019-01-02 09:38 UTC by Riccardo Schirone
Modified: 2023-03-24 14:27 UTC (History)
3 users (show)

Fixed In Version: systemd 237
Doc Type: If docs needed, set a value
Doc Text:
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:
Last Closed: 2019-08-06 19:20:28 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2091 0 None None None 2019-08-06 12:13:47 UTC

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:

Upstream issue:

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.

Comment 6 errata-xmlrpc 2019-08-06 12:13:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2091 https://access.redhat.com/errata/RHSA-2019:2091

Comment 7 Product Security DevOps Team 2019-08-06 19:20:28 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


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