fix: remove unsafe Bluetooth D-Bus exposure - #1244
Conversation
Remove the path-based BluetoothGetDeviceTechnologies method from the system daemon and keep DebugInfo compatible while returning no adapter or device data. Pms: BUG-370875, BUG-370897 删除系统守护进程中存在路径拼接风险的 BluetoothGetDeviceTechnologies 接口,并保留 DebugInfo 的 D-Bus 兼容签名但不再返回适配器和设备敏感信息。 Change-Id: I4b9e1a61c3c1cfd5245ca7f7ed97a6ff8097e4cb
Reviewer's GuideRemoves the unsafe BluetoothGetDeviceTechnologies D-Bus API and its path-based access from the system daemon, while preserving DebugInfo method compatibility by returning an empty snapshot and testing that behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="bin/dde-system-daemon/exported_methods_auto.go" line_range="12-16" />
<code_context>
func (v *Daemon) GetExportedMethods() dbusutil.ExportedMethods {
return dbusutil.ExportedMethods{
- {
- Name: "BluetoothGetDeviceTechnologies",
- Fn: v.BluetoothGetDeviceTechnologies,
- InArgs: []string{"adapter", "device"},
- OutArgs: []string{"technologies"},
- },
{
Name: "ClearTty",
</code_context>
<issue_to_address>
**🚨 issue (security):** Removing the D-Bus registration does not remove the underlying path-based Bluetooth technology reader: `device.getTechnologies` and `doGetDeviceTechnologies` remain in the system daemon and still read caller-derived filenames through `KeyFile.LoadFromFile`. The unsafe code is therefore still present and can be re-exposed by any remaining or future internal call.
**Triggers:** When code in the system daemon invokes the retained `getTechnologies` helper.
**Suggested fix:** Delete the unused `device.getTechnologies` and `doGetDeviceTechnologies` implementations, along with the now-unneeded path/file imports and constants.
</issue_to_address>| Name: "BluetoothGetDeviceTechnologies", | ||
| Fn: v.BluetoothGetDeviceTechnologies, | ||
| InArgs: []string{"adapter", "device"}, | ||
| OutArgs: []string{"technologies"}, | ||
| }, |
There was a problem hiding this comment.
🚨 issue (security): Removing the D-Bus registration does not remove the underlying path-based Bluetooth technology reader: device.getTechnologies and doGetDeviceTechnologies remain in the system daemon and still read caller-derived filenames through KeyFile.LoadFromFile. The unsafe code is therefore still present and can be re-exposed by any remaining or future internal call.
Triggers: When code in the system daemon invokes the retained getTechnologies helper.
Suggested fix: Delete the unused device.getTechnologies and doGetDeviceTechnologies implementations, along with the now-unneeded path/file imports and constants.
|
TAG Bot New tag: 6.1.106 |
Pms: BUG-370875, BUG-370897
Summary by Sourcery
Remove unsafe Bluetooth data exposure while maintaining compatibility for existing D-Bus clients.
Bug Fixes:
Enhancements:
Tests: