Skip to content

Harden BLE SPP command buffer length handling#197

Open
orbisai0security wants to merge 1 commit into
grblHAL:masterfrom
orbisai0security:fix-v-007-main-bluetooth-le.c
Open

Harden BLE SPP command buffer length handling#197
orbisai0security wants to merge 1 commit into
grblHAL:masterfrom
orbisai0security:fix-v-007-main-bluetooth-le.c

Conversation

@orbisai0security
Copy link
Copy Markdown

@orbisai0security orbisai0security commented May 18, 2026

Summary

This PR applies a small defensive hardening change to the WIP BLE SPP command handling path.

Changes:

  • main/bluetooth_le.c
  • Check p_data->write.len before copying into the allocated SPP command buffer.
  • Avoid copying more than the allocated MTU-derived buffer size.
  • Replace a few unbounded string writes with bounded variants.

This does not claim to make the BLE SPP implementation complete or to add authentication/pairing enforcement. It is intended only as a narrow memory-safety hardening cleanup.

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

The Bluetooth LE SPP command buffer at bluetooth_le

Assisted-by: OrbisAI Security <noreply@orbisappsec.com>
@terjeio
Copy link
Copy Markdown
Contributor

terjeio commented May 18, 2026

Does this fix the code so it works now? It did not before (was WIP).

@orbisai0security
Copy link
Copy Markdown
Author

Thanks for checking. No, this PR does not make the BLE SPP implementation fully functional, and I should not have framed it as a complete authentication/security fix.

The actual change is narrower: it hardens the WIP BLE command write path by bounding p_data->write.len before copying into the allocated SPP command buffer, and replaces a few unbounded string writes with bounded variants.

I’ll retitle/rewrite the PR as a defensive hardening cleanup rather than a critical vulnerability fix.

@orbisai0security orbisai0security changed the title fix: the bluetooth le spp command buffer at bluetoot... in... Harden BLE SPP command buffer length handling May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants