/

CVE-2026-76640

Severity:

HIGH RISK

(7.5)

Stack Buffer Overflow (CWE-787) in Unitree G1 BLE GATT

CVE-2026-76640

Deferred

Vulnerability type

Category:

Memory Buffer Overflow

CWE:

CWE-306, CWE-787

Impact:

Unauthenticated Root Code Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
boschko.caboschko.ca/g1-ble-rce/
github.comgithub.com/OlivierLaflamme/UniBLEed
vulncheck.comvulncheck.com/advisories/unitree-g1-edu-ble-gatt-rce-via-wifi-provisioning-stack

Frequently asked

questions

It is best understood as a proximate wireless attack. An attacker generally

needs BLE communication range, but does not necessarily need pairing,

credentials, or local shell access.

The attacker needs the device to expose the affected BLE provisioning service

and accept crafted GATT writes. The described chain does not require an

authenticated BLE session.

Enforce authentication and authorization before provisioning actions, validate

every input length before storage, remove unsafe shell interpolation, and

avoid running provisioning logic with root privileges.

Use memory-safe or rigorously bounded parsing, fuzz fragmented protocol input,

review privileged command paths, apply least privilege, and enforce security

policies for unauthenticated device-management interfaces.

Find out what's already
exploitable in your codebase.