-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider warning about trusting Address::system #1275
Comments
But the CVE summary says:
However, I don't have any objections to what you're proposing. It should be noted that this is not a security issue in zbus and any changes resulting from this issue will purely to save users from making dangerous mistakes.
Sure but I think this should be part of the spec then. If this makes sense, it makes sense for all D-Bus libraries out there. If we just do this on our own, we'll actually be going against the spec, which says that:
My interpretation here is that if the env is set, applications should use it. So that would be another reason I'd like this to be part of the spec before we implement it in zbus. |
@complexspaces would you be providing the PR? |
Closes dbus2#1275 by adding basic and sufficient, but attention-grabbing, documentation to all `system*` methods in the crate which either are or utilize the result of zbus::Address::system to describe their security properties. I took the approach to centralize the details/important parts on zbus::Address::system and then use interdoc links to redirect all of the other "affected" callsites there to reduce duplication.
Good afternoon,
Today
zbus::Address
has a convenientsystem()
function on it which attempts to resolve where the socket for system-level services on the current platform/host are. However, this is primarily reliant on reading an environment variable:zbus/zbus/src/address/mod.rs
Lines 90 to 91 in 0b3b6b1
As you probably know, environment variables can be manipulated in a lot of ways by software running even with same user privileges and attempting to start other apps in weird ways. For example this resulted in CVE-2012-3524 for
libdbus
back in 2012. This case was primarily about attackingsetuid
programs but the general concern of handling untrusted data in sensitive contexts remains.I would primarily recommend adding an obvious warning to the documentation of the aforementioned function, but also all of the other public methods that return something from the "system" to note that
zbus
doesn't do any kind of security checks on the returned connection, and that individual users are responsible for validating if it is actually owned by the "system" or not. As a secondary recommendation, you could also detect specifically running in a "privileged" binary at runtime and use a well-known hardcoded path instead of an untrusted environment read.The text was updated successfully, but these errors were encountered: