Summary
Unitree G1 EDU firmware through 1.5.2 contains chained flaws in its BLE GATT server and WiFi provisioning stack that can let an unauthenticated nearby attacker reach root-level code execution without pairing or credentials. The risk arises when crafted BLE writes trigger unsafe SSID accumulation and the resulting memory corruption reaches a privileged command-execution path.
Affected context
The vulnerability affects Unitree G1 EDU firmware deployments that expose the BLE GATT provisioning interface and use the affected WiFi provisioning workflow. Exploitation depends on the BLE service accepting attacker- controlled writes, the SSID data being processed across connections, and the corrupted state reaching cleanup logic that runs with elevated privileges.
Exploit preconditions
- Attack surface: Proximate BLE GATT provisioning interface - Required access: Physical or radio proximity sufficient to communicate with
the device; pairing and application credentials may not be required
- Trigger point: Processing and accumulation of attacker-controlled SSID
chunks followed by the affected cleanup path
- Why exploitation is possible: A fixed-size buffer can be overrun, allowing
adjacent control data to be corrupted; the provisioning path also contains
an unsafe shell heredoc variable use and ultimately invokes a command
execution mechanism with uid 0
Why this happens
The primary flaw is an out-of-bounds write caused by accumulating untrusted SSID chunks in a fixed-size buffer without adequate bounds enforcement. This maps to CWE-787, because attacker-controlled data can write beyond the intended memory object and corrupt adjacent control-flow state. The chain is compounded by missing authentication in the BLE service (CWE-306) and an unquoted shell heredoc variable in the provisioning script, which reduces the trust boundary around data passed into privileged command execution.
Potential impact
- An attacker may execute arbitrary code with root privileges
- The device could be fully compromised or rendered unavailable
- WiFi and BLE configuration data could be altered
- Device credentials, operational data, or stored secrets could be exposed
- A compromised device could be used for network pivoting or broader fleet attacks
General mitigation guidance
Mitigation generally focuses on eliminating unauthenticated privileged control paths and enforcing memory-safe handling of protocol data. Secure patterns include strict length validation before every accumulation or copy, explicit per-connection and total-size limits, safe shell argument handling, and avoiding command interpreters for configuration operations. BLE provisioning can use authenticated enrollment and narrowly scoped authorization, while device services should run with least privilege, isolate provisioning components, and avoid writable control data adjacent to function pointers where practical.
How teams detect issues like this
Detection can include static analysis for unchecked length arithmetic, fixed-buffer writes, unsafe string operations, unquoted shell expansion, and privileged calls to system-like APIs. Code review should examine BLE message reassembly across connections, cleanup and error paths, function-pointer dispatch, and whether provisioning writes are authenticated. Fuzzing BLE GATT write handlers with fragmented and oversized inputs, runtime memory-safety instrumentation, and policy checks that prohibit unauthenticated privileged provisioning can provide additional coverage. Automated security review tools may help identify these patterns during development.

