forked from coreos/rpm-ostree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request coreos#4911 from travier/fix-cve-2024-2905
CVE-2024-2905: passwd: create /etc/[g]shadow with mode 0 & unit: chmod /etc/[g]shadow[-] to 0000
- Loading branch information
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[Unit] | ||
# rpm-ostree v2023.6 introduced a permission issue on `/etc/[g]shadow[-]`. | ||
# This makes sure to fix permissions on systems that were deployed with the wrong permissions. | ||
Description=Update permissions for /etc/shadow | ||
Documentation=https://github.com/coreos/rpm-ostree-ghsa-2m76-cwhg-7wv6 | ||
ConditionPathExists=!/etc/.rpm-ostree-shadow-mode-fixed.stamp | ||
ConditionPathExists=/run/ostree-booted | ||
# Make sure this is started before any unprivileged (interactive) user has access to the system. | ||
Before=systemd-user-sessions.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=chmod --verbose 0000 /etc/shadow /etc/gshadow | ||
ExecStart=-chmod --verbose 0000 /etc/shadow- /etc/gshadow- | ||
ExecStart=touch /etc/.rpm-ostree-shadow-mode-fixed.stamp | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters