Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
dpath = _mac_to_device_path(apath, mac) dobj = bus.get_object(BLUEZ_SERVICE, dpath) diface = dbus.Interface(dobj, DEVICE_IFACE) method = getattr(diface, op) try: method(timeout=int(timeout * 1000)) except dbus.DBusException as e:- Confidence
- 88% confidence
- Finding
- `device_op()` performs dynamic method dispatch with `getattr(diface, op)` on a D-Bus device interface without restricting which operations are allowed. If an upstream caller can influence `op`, they can invoke unintended state-changing BlueZ methods such as pairing, connecting, disconnecting, or cancellation operations, expanding the attack surface beyond the library's apparent API and bypassing expected authorization or safety checks at the application layer.
