Bugzilla – Bug 1216373
VUL-0: shadowsocks-rust: systemd services run unnecessarily as root with full privileges
Last modified: 2024-01-16 12:55:59 UTC
+++ This bug was initially created as a clone of Bug #1212862 While reviewing shadowsocks-rust I noticed that our packaging provides systemd services that let the various daemons runs with full root privileges. The daemons don't actually need root privileges. At most they need the capability CAP_NET_BIND_SERVICE to listen on ports lower 1024. The upstream repository contains example systemd services beneath the debian/ directory that seem to be smarter than what we have: shadowsocks-rust.service: this lets the service run as nobody:nogroup shadowsocks-rust-server@.service: this allows running multiple configurations of the service. The privilege drop logic is unclear though, the service still runs as root, but with a capability bounding set of CAP_NET_BIND_SERVICE. This is a bit of a strange setup though, a root user that has lost most of its capabilities. I am unsure whether this is sufficient isolation. For addressing this also bug 1216372 about the world readable configuration directory and configuration files should be kept in mind. Introducing a dedicated user and group for shadowsocks that has read access to these files might be the cleanest approach.
This is an autogenerated message for OBS integration: This bug (1216373) was mentioned in https://build.opensuse.org/request/show/1119866 Factory / shadowsocks-rust
This is an autogenerated message for OBS integration: This bug (1216373) was mentioned in https://build.opensuse.org/request/show/1120484 Factory / shadowsocks-rust
The daemons now all run as dedicated shadowsocks user and group so this should be addressed.
This is an autogenerated message for OBS integration: This bug (1216373) was mentioned in https://build.opensuse.org/request/show/1133426 Backports:SLE-15-SP4 / shadowsocks-libev https://build.opensuse.org/request/show/1133428 Backports:SLE-15-SP5 / shadowsocks-libev
openSUSE-RU-2023:0408-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1216372,1216373 CVE References: JIRA References: Sources used: openSUSE Backports SLE-15-SP4 (src): shadowsocks-libev-3.3.5-bp154.3.3.1
openSUSE-RU-2023:0412-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1216372,1216373 CVE References: JIRA References: Sources used: openSUSE Backports SLE-15-SP5 (src): shadowsocks-libev-3.3.5-bp155.4.3.1
The service units now use proper privilege drops to the shadowsocks user and group