Products › lamco-dbus-tools › Use cases

A D-Bus policy deny lost in the switch to dbus-broker

A D-Bus policy deny lost in the switch to dbus-broker: A send_interface rule refuses a call with no interface on dbus-daemon, and not on dbus-broker.

After a system bus moves from dbus-daemon to dbus-broker, a policy file's deny can stop refusing a call, and nothing warns. lamco-dbus-tools found it with dbussee, which read the policy as each bus reads it, dbusdo, which held the answer to both real daemons, and dbustell, whose audit and policy named the rule on each.

A real run on 2026-11-30 on Debian 13, with dbus-daemon 1.16.2 and dbus-broker 37 each on a private bus, with a development build of lamco-dbus-tools, version 0.1.0, and run again later by run.sh with the same output. The service and its file, com.example.Printer.conf, are made up for this page, not a real package's; every output quoted is in the use case's directory.

The situation

A distribution moves its system bus from dbus-daemon to dbus-broker. Ubuntu plans that for 26.10. Every package's policy file in /usr/share/dbus-1/system.d is then read by a different program, and the two don't read every file the same way. Nothing warns: dbus-broker starts, the services start, and a rule that used to refuse something no longer does.

com.example.Printer.conf is a file of a common shape: It lets every user call the service, then refuses one administrative method by its interface.

<policy context="default">
  <allow send_destination="com.example.Printer"/>
  <deny send_destination="com.example.Printer" send_interface="com.example.Printer.Admin" send_member="Reset"/>
</policy>

An audit names the file

$ dbussee audit collect --root root --no-score --no-bus --out audit.json
$ dbustell audit audit.json
POL-004 A policy file reads differently on the two bus implementations: .../com.example.Printer.conf: line 3: <allow own="com.example.Printer"/> also grants the names below it on dbus-broker; line 7: <deny send_destination="com.example.Printer" send_interface="com.example.Printer.Admin" send_member="Reset"/> also refuses a call with no interface on dbus-daemon, and not on dbus-broker.

root is a copy of this machine's bus configuration with the file added. On the machine's own files, 39 others read differently too, most for the same two reasons.

One question

A method call may leave out its interface. The D-Bus specification says that a service then may either return an error or "deliver the message as though it had an arbitrary one of those interfaces", and dbus-daemon(1) warns that "the interface field in messages is optional".

$ dbustell policy audit.json --user "$USER" --call com.example.Printer - Reset
dbus-daemon: denied, by .../com.example.Printer.conf:7 <deny send_destination="com.example.Printer" send_interface="com.example.Printer.Admin" send_member="Reset"/>
dbus-broker: allowed, by .../com.example.Printer.conf:6 <allow send_destination="com.example.Printer"/>

Both daemons, for real

That answer is the evaluator's. dbusdo policy probe gives the file to each real daemon, after the stock system bus's rules, and sends the calls to a stand-in:

$ dbusdo policy probe --base system --probes probes.txt com.example.Printer.conf
  dbus-daemon  call com.example.Printer com.example.Printer.Admin Reset / denied
  dbus-daemon  call com.example.Printer - Reset /                   denied
  dbus-daemon  call com.example.Printer com.example.Printer Print / allowed
  dbus-broker  call com.example.Printer com.example.Printer.Admin Reset / denied
  dbus-broker  call com.example.Printer - Reset /                   allowed
  dbus-broker  call com.example.Printer com.example.Printer Print / allowed
The evaluator agrees with every daemon on every probe.

dbus-daemon applies a deny by interface to a call that has none; dbus-broker applies it only to calls that name the interface. Whether the call with no interface then reaches Reset is up to the service and its binding, which the specification leaves open. A policy file that means to keep a method from ordinary users shouldn't depend on which. The shape is common: dbus-daemon(1)'s own example of a deny is <deny send_destination="org.freedesktop.Service" send_interface="org.freedesktop.System" send_member="Reboot"/>.

The fix

Allow what users may call instead of denying what they mayn't, as com.example.Printer.fixed.conf does:

<policy context="default">
  <allow send_destination="com.example.Printer" send_interface="com.example.Printer"/>
  <allow send_destination="com.example.Printer" send_interface="org.freedesktop.DBus.Introspectable"/>
</policy>
$ dbusdo policy probe --base system --probes probes.txt com.example.Printer.fixed.conf
  dbus-daemon  call com.example.Printer com.example.Printer.Admin Reset / denied
  dbus-daemon  call com.example.Printer - Reset /                   denied
  dbus-daemon  call com.example.Printer com.example.Printer Print / allowed
  dbus-broker  call com.example.Printer com.example.Printer.Admin Reset / denied
  dbus-broker  call com.example.Printer - Reset /                   denied
  dbus-broker  call com.example.Printer com.example.Printer Print / allowed
The evaluator agrees with every daemon on every probe.

The two daemons now agree, because the stock rules deny every method call by default and nothing allows one with no interface.

What made it findable

  • The policy is read twice, once as each implementation reads it, so a difference is a finding before the switch, not a surprise after.
  • A verdict names the rule that decided it on each daemon.
  • policy probe settles it on the real daemons in a private bus, touching nothing on the machine.

Related