|
| 1 | +--- |
| 2 | +description: CVE-2026-62661, HIGH, The Reachy Mini Bluetooth command handler is vulnerable to Arbitrary Root Script Execution via Path Traversal |
| 3 | + |
| 4 | +title: The Reachy Mini Bluetooth command handler is vulnerable to Arbitrary Root Script Execution via Path Traversal |
| 5 | + |
| 6 | +date_published: "2026-08-25" |
| 7 | +last_updated: "2026-08-25" |
| 8 | +xray_id: |
| 9 | +vul_id: CVE-2026-62661 |
| 10 | +cvss: 7.2 |
| 11 | +severity: high |
| 12 | +discovered_by: Natan Nehorai |
| 13 | +type: vulnerability |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Summary |
| 18 | + |
| 19 | +The Reachy Mini Bluetooth command handler is vulnerable to Arbitrary Root Script Execution via Path Traversal |
| 20 | + |
| 21 | + |
| 22 | +## Component |
| 23 | + |
| 24 | +reachy-mini (Bluetooth command service) |
| 25 | + |
| 26 | +## Affected versions |
| 27 | + |
| 28 | +< 1.10.0 |
| 29 | + |
| 30 | +## Description |
| 31 | + |
| 32 | +The Reachy Mini Bluetooth command handler (BluetoothCommandService._handle_command in src/reachy_mini/daemon/app/services/bluetooth/bluetooth_service.py) accepts a CMD_<script> payload after a successful PIN authentication and runs the matching file from the commands/ directory with sudo. The script name is taken from the BLE payload with no sanitization and combined using os.path.join("commands", script_name). On POSIX, if the second argument is an absolute path, os.path.join discards the commands/ prefix entirely, so a payload such as CMD_/tmp/reachy_pwn causes the handler to execute sudo /tmp/reachy_pwn.sh. Relative payloads such as CMD_../attacker/pwn likewise escape the intended directory. An attacker who can place a .sh file on the filesystem — for example via the unrestricted media-sounds upload (CVE-2026-55419) — can therefore run that script as root. |
| 33 | + |
| 34 | +This issue is the third step in a documented compromise chain: unrestricted file upload, Bluetooth authentication bypass, then this directory traversal. The published CVSS score (7.2, AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H) reflects authenticated Bluetooth access. |
| 35 | + |
| 36 | +## PoC |
| 37 | + |
| 38 | +<br> |
| 39 | + |
| 40 | +**Step 1 - Confirm the os.path.join bypass** |
| 41 | + |
| 42 | +<br> |
| 43 | + |
| 44 | +``` |
| 45 | +python3 -c "import os; print(os.path.join('commands', '/tmp/reachy_pwn.sh'))" |
| 46 | +``` |
| 47 | + |
| 48 | +<br> |
| 49 | + |
| 50 | +Expected output: |
| 51 | + |
| 52 | +``` |
| 53 | +/tmp/reachy_pwn.sh |
| 54 | +``` |
| 55 | + |
| 56 | +<br> |
| 57 | + |
| 58 | +The first argument is discarded because the second argument is an absolute path. |
| 59 | + |
| 60 | +<br> |
| 61 | + |
| 62 | +**Step 2 - Authenticate on the Bluetooth command characteristic** |
| 63 | + |
| 64 | +<br> |
| 65 | + |
| 66 | +From a BLE client (nRF Connect, Web Bluetooth, or the Reachy Mini control app), write the robot PIN as: |
| 67 | + |
| 68 | +``` |
| 69 | +PIN_<last_5_digits_of_serial> |
| 70 | +``` |
| 71 | + |
| 72 | +<br> |
| 73 | + |
| 74 | +Expected response: |
| 75 | + |
| 76 | +``` |
| 77 | +OK: Connected |
| 78 | +``` |
| 79 | + |
| 80 | +<br> |
| 81 | + |
| 82 | +**Step 3 - Send an absolute CMD_ payload** |
| 83 | + |
| 84 | +<br> |
| 85 | + |
| 86 | +The handler appends `.sh` to whatever follows `CMD_`. After authentication, write: |
| 87 | + |
| 88 | +``` |
| 89 | +CMD_/tmp/reachy_pwn |
| 90 | +``` |
| 91 | + |
| 92 | +<br> |
| 93 | + |
| 94 | +On a vulnerable build this resolves to `sudo /tmp/reachy_pwn.sh` instead of a file under `commands/`. The same escape works with a relative payload such as `CMD_../attacker/pwn`. |
| 95 | + |
| 96 | +<br> |
| 97 | + |
| 98 | +**Step 4 - Confirm with the vendor regression test** |
| 99 | + |
| 100 | +<br> |
| 101 | + |
| 102 | +On a Linux checkout of reachy_mini 1.10.0 or later: |
| 103 | + |
| 104 | +``` |
| 105 | +pytest tests/unit_tests/test_ble_path_traversal.py -v |
| 106 | +``` |
| 107 | + |
| 108 | +<br> |
| 109 | + |
| 110 | +Those tests assert that the handler never invokes sudo on a path outside `commands/`. They fail against unpatched trees (PATH TRAVERSAL: handler invoked sudo ...) and pass once the command name is constrained to a bare `[A-Za-z0-9_-]+` filename. |
| 111 | + |
| 112 | +## Vulnerability Mitigations |
| 113 | + |
| 114 | +Upgrade to reachy-mini 1.10.0 or later. The fix takes only the final slash-separated component of the client-supplied command name and allow-lists `[A-Za-z0-9_-]` before joining it into `commands/` (https://github.com/pollen-robotics/reachy_mini/commit/caed7d88cd5190c8789cfa4f7d8e34c48ccb14d9). Until then, restrict Bluetooth pairing to trusted devices and do not leave attacker-writable `.sh` files on the robot filesystem. |
| 115 | + |
| 116 | +## References |
| 117 | +https://github.com/pollen-robotics/reachy_mini/security/advisories/GHSA-vg3x-4hxm-3gxm |
| 118 | +https://github.com/pollen-robotics/reachy_mini/commit/caed7d88cd5190c8789cfa4f7d8e34c48ccb14d9 |
| 119 | +https://github.com/pollen-robotics/reachy_mini/releases/tag/v1.10.0 |
| 120 | +https://nvd.nist.gov/vuln/detail/CVE-2026-62661 |
0 commit comments