7 ms·
ESP32 Undocumented Bluetooth Commands: Clearing the Air
- MasterYoda 2y agoWhich good alternatives to esp32 are there? Thinking most on functionality, dont care so much about the cost.
- thijson 2y agoThe Raspberry Pi Pico also has Bluetooth and WiFi.
- rfoo 2y agotl;dr whichever system using an ESP32 as a bluetooth adapter may also just run arbitrary code on the ESP32 itself over the same interface. Commands have to be issued from the host system, not from the air. This sounds like... a good feature? There are indeed some scenarios where doing so poses a security risk. But most of the time I do want to be able to run arbitrary code on e.g. my WiFi dongle when I'm in control. I know FCC is not a fan of this idea though.
- mrheosuper 2y agoUnless you reverse engineer the radio firmware, i dont think you can change the RF front end much
- Jochim 2y agoI agree! Your system is already heavily compromised if this is a problem for you. I think the real problem lies in a lack of visibility into the state of the device. A compromised dongle could easily be transferred between machines. What we need is to make obvious what the machine/device is doing.
- unsnap_biceps 2y agoEsp32 devices support enforcement of signed firmware that prevents the issue if it's in your threat model. https://docs.espressif.com/projects/esp-idf/en/stable/esp32/security/secure-boot-v1.html https://docs.espressif.com/projects/esp-idf/en/stable/esp32/...
- unsnap_biceps 2y ago> Espressif will document all Vendor-specific HCI commands to ensure transparancy of what functionality is available at the HCI layer I'm very glad they're going to be more transparent rather than try to lock things down more. I've been impressed with Espressif over the years and I'm glad they're continuing to impress.
- looofooo0 2y agoIt is a relative small company which is catering the DIY market. To build any substantial user base with industrial applications, I guess their way is to continue to be open and enable people to build DIY stuff and a tiny fraction of these will one day build products with ESP chips inside.
- Crosseye_Jack 2y agoI've in no way surveyed the whole wifi mcu market. But wasn't the "beginnings" of Espressif in the western world that it was a cheap wifi mcu that was at the time very popular in cheap Chinese wifi enabled products. The DIY market (at least in the west) came later. I still remember reading the hackaday article about them being discovered back in the day - https://hackaday.com/2014/08/26/new-chip-alert-the-esp8266-wifi-module-its-5/ https://hackaday.com/2014/08/26/new-chip-alert-the-esp8266-w... and back then all the documentation was in Chinese. I remember a ton of cheap Chinese wifi enabled stuff would come with an esp for a good while, until even cheaper wifi chips hit the market.
- looofooo0 2y agoI think they made it DIY friendly in China first.
- mystified5016 2y agoThe biggest factor (IMO) is that during the pandemic chip shortages, about the only WiFi/BT module in stock anywhere was espressif. They consistently had stock when no one else did, so a lot of home hackers got into it. As our industry is so fond of forgetting and rediscovering, if your product is easy and accessible to home hackers, it will be used in those hackers' real jobs. But also they're so goddamn cheap. Espressif somehow scaled production super fast and got the price way below any of the competition.
- rswail 2y agoIn other words, this was a beatup for internet points, not, in any way, an actual security issue.
- nraynaud 2y agoWell it was very clear from the beginning that these were a set of debug commands. A back door would probably have a door knocking semantics and a very limited apparent surface. These were direct memory reading and writing command and were available in a standardized protocol. I would think the real issue was wether they were closed enough in real world design to avoid a security issue through debug means.
- atoav 2y agoIf their goal was to get espressif to explain undocumented functionality they reached it. And espressif should have closed that gap without external pressure.
- mort96 2y agoIf the researchers had written articles and held talks about undocumented HCI commands to gain direct access to the chip, and hammered on the security impact of having such undocumented commands, they could've probably achieved the same thing without resorting to lying.
- close04 2y ago> Researchers Miguel Tarascó Acuña and Antonio Vázquez Blanco of Tarlogic Security, who presented their findings yesterday at RootedCON in Madrid. > "Tarlogic Security has detected a backdoor in the ESP32, a microcontroller that enables WiFi and Bluetooth connection and is present in millions of mass-market IoT devices I'd like to believe the didn't have ulterior reasons to cry "backdoor" knowing that's not the case. That would be a huge indictment of the researchers' characters. They wanted the spotlight and calling something a "backdoor in a chip used by a billion devices" does the job.
- ChrisRR 2y agoI think their real goal was to gain customers for their security research business
- Jochim 2y agoRelated: Undocumented backdoor found in Bluetooth chip used by a billion devices https://news.ycombinator.com/item?id=43301369 https://news.ycombinator.com/item?id=43301369
- ElectRabbit 2y agoOn the HCI interface. That's not a OTA attack. If an attacker can write raw data the HCI interface you are doomed anyway.
- blitzar 2y agoIf you have access to the targets computer and their password there is an attack vector where you can feasibly gain access their files.
- mystified5016 2y agoIf and only if the host's serial or HCI driver has some undocumented exploit to gain code execution. (They probably don't)
- raphman 2y agoContext: https://www.tarlogic.com/news/hidden-feature-esp32-chip-infect-ot-devices/ https://www.tarlogic.com/news/hidden-feature-esp32-chip-infe... Both HN discussion [1] and blogs [2] mentioned that it was a nothingburger. tl;dr: there are undocumented debugging interfaces on the original ESP32 chip that can only be accessed by code running on the microcontroller or via another computer connected via the physical UART interface. No remote exploit possible. Espressif will now provide a patch to disable these debugging interfaces and document all yet-undocumented interfaces. [1] https://news.ycombinator.com/item?id=43301369 https://news.ycombinator.com/item?id=43301369 [2] https://darkmentor.com/blog/esp32_non-backdoor/ https://darkmentor.com/blog/esp32_non-backdoor/
- sschueller 2y agoYou should be switching off the bluetooth on your device if is not needed. CE also has some regulations regarding this. I use the ESP32 in my product[1] I am glad they exist. Their per-certified modules save you quite a bit of money when you do your CE testing. Espressif also offer free design review if you are using their chip in your commercial project/product[2]. [1] https://www.stationdisplay.com/ https://www.stationdisplay.com/ [2] https://www.espressif.com/en/contact-us/circuit-schematic-pcb-design-review https://www.espressif.com/en/contact-us/circuit-schematic-pc...
- pjc50 2y ago> CE also has some regulations regarding this. Which part of CE? One of the ETSI standards?
- sschueller 2y agoI don't know the exact standard. I was told this by one of the many people I worked with trying to get my CE. If I recall correctly it may have to do with the new IoT Cyber Resilience Act stuff.
- rickdeckard 2y agoI guess this is more about "if your product has bluetooth functionality, this section of compliance also applies to your product" than "we have regulation on switching off bluetooth"
- stogot 2y agoWhat is CE?
- sschueller 2y agohttps://europa.eu/youreurope/business/product-requirements/labels-markings/ce-marking/index_en.htm https://europa.eu/youreurope/business/product-requirements/l... Like FCC with extras but for the European region.
- spaintech 2y agoFirst and foremost, I have no affiliation with any of the authors previously mentioned. However, I would like to pose a question to the community: Is it feasible to exploit these undocumented HCI commands to develop malicious firmware for the ESP32? Such firmware could potentially be designed to respond to over-the-air (OTA) signals, activating these hidden commands to perform unauthorized actions like memory manipulation or device impersonation. However, considering that deploying malicious firmware already implies a significant level of system compromise, how does this scenario differ from traditional malware attacks targeting x86 architectures to gain low-level access to servers?
- jwr 2y agoIt is feasible to develop malicious firmware for the ESP32 even without these HCI commands. The existence of these undocumented commands doesn't change anything.
- Etheryte 2y agoThis would require you to have root access to the thing, at that point you might as well write literally any code you like and not bother with the HCI commands.
- gblargg 2y agoJust wait until these security researchers learn about the LDR instruction that malicious software could use to read any memory.
- u5wbxrc3 2y agoAs the article states "These undocumented HCI commands cannot be triggered by Bluetooth, radio signals, or over the Internet, unless there is a vulnerability in the application itself or the radio protocols.". Hence I dont think there is any security risk here assuming the application and radio is safe. It differs in a way that the person must have access to the device to flash firmware I believe. In x86 as you describe, the person could attack with a connection to the device/machine.
- dengjiuhong 2y agoYet, a significant number of stock investors still suffer heavy losses because the market gets rattled by these exaggerated, attention-grabbing headlines. While the consensus here rightly labels this a non-issue—debug commands, not a backdoor, with no remote exploit possible—the sensationalism still has real-world impact. It’s frustrating to see how security hype, often just for internet clout or CVEs as pointed out, can overshadow Espressif’s solid response and transparency efforts, leaving retail investors to bear the brunt of the volatility.
- Lanolderen 2y agoOn the other hand you could buy the dip with your field knowledge assuming you believe it's undervalued.
- flanked-evergl 2y agoHopefully we will see something similar to defamation cases brought here.
- IshKebab 2y agoTheir stock price hasn't changed significantly with this news.
- K0balt 2y agoAt first I thought this smelled like a Targeted PR drive-by, leveraging the distrust of China to intensify anti-China sentiment for political traction. I’ve been quite cynical about this ever since I was exposed to shady PR companies and saw their list of offerings and prices…. But… Nope. This looks like an irresponsible, hype seeking disclosure by a security firm trying to make a name for itself. Or maybe a really, really good PR firm and a PR savvy security firm, if I put my tinfoil hat on.
- nonrandomstring 2y agoStorm in a teacup. But it raises an interesting question. Why are these HCI commands "undocumented"? A phrase I hear around security nowadays is "Shadow API" [0, 1] A shadow API is an undocumented one, and it tends to set-off massive alarm bells. The researchers were clearly too keen to make a splash, and that reflects a sad state of wannabeism and hustling for crumbs these days. What exacerbates it is proprietary software - stuff that's hidden, obscured, opaque, deceptive, distributed as mysterious "blobs".... this entire cluster of behaviour raises red flags and gets people looking for things. And when we go looking for things that aren't there ... we find them (assume the worst). That is to say, the researchers are reacting emotionally (but with good justification) to discovering undocumented features, aka a "shadow API". This could have been avoided if the device maker had just documented them. Why didn't they? [0] https://www.cybershow.uk/episodes.php?id=39 https://www.cybershow.uk/episodes.php?id=39 [1] https://www.cloudflare.com/learning/security/api/what-is-shadow-api/ https://www.cloudflare.com/learning/security/api/what-is-sha...
- londonembedded 2y agoAll of this higher level HCI and API shiz rests (in the embedded world) on a set of registers which are usually documented in the daatsheet. By manipulating these registers, the developer can make the IC do anything it is capable of doing: it is the ultimate API, and there is almost no means in code of making the hardware do anything except by this means. So any 'shadow' API is not really of any consequence in embedded, because it all boils down to these registers, which we can perfectly well view or manipulate. Espressif, as well as all other manufacturers of such BLE enabled SoCs provide at least some parts of their RF stack as precompiled binary. However, Espressif took the decision to deliberately not publish the registers used at lowest level to configure and command the RF peripheral on the IC. All other manufacturers I am aware of publish these registers, just like all the others. Ultimately this minor obfuscation offers no additional security benefit, nor does it create any security loophole above any that exist on any other chipset.
- numpad0 2y agoI was looking up vacuum tube recently. Apparently there are things called "getter" pins in them that connects to internal material deposition device, used to remove last bits of air out of tube in the manufacturing line. The exact behaviors and operating parameters for those pins are corporate secrets and not documented. Datasheets only mention them as "No Connect" pins that do nothing and has to be disconnected from anything for safe and correct operation of the device. BACKDOOR!!! in an analog vacuum tube. ... everything ever always had factory-use-only interfaces. Manufacturers don't document every bits of everything on public datasheets. Granted, the dynamics of this change if they can be used as backdoors, and those might have to be either disclosed or securely disabled, but "why they exist in the first place" is just nonsensical question; they exist for necessary internal purposes. That question should be "how should factory use interfaces be handled going forward".
- londonembedded 2y agoThis is an absolute non-issue, as others have commented. Even without domain-specific knowledge, we can see this is all nonsense: 'Allow attackers to carry out impersonation attacks' - the same thing that can be done with any number of legitimate and useful applications designed for developing with BLE, available on Android marketplace :*) On any embedded platform which allows low level access to a radio transciever of any kind, it is possible to exercise all functionality, which will include various possible attacks. The only thing which prevents this in the industry at present is obfuscation, which most manufacturers (other than Espressif) dont bother with. Take Nordic for example, who make probably the best and most widely used/respected BLE chipset: the full functionality of the transciever can be used via a relatively small set of registers, which are fully documented. Nordic supply a BLE stack, but you can perfectly well write your own instead, meaning that you can deliberately or accidentally abuse all aspects of the protocol. Even at physical level, one can easily conduct simple jamming attacks, by broadcasting full power carrier signal on the BLE advertising channels. None of this naughtiness is a security flaw. BLE and other wireless protocols in common use are well designed to be resistant to jamming, and the physical implementation of the radios on various SoCs available currently are limited: you cant put out 10 watts of hash over 82 channels at once, because the silicon doesnt support it. You cant even 'sniff' BLE traffic in a real sense, because the silicon on requires a significant number of bytes of 'address' in order to capture any meaningful packet data from ambient noise. Here is C code, as a fun example, to broadcast full power carrier on any channel, from Nordic NRF52. This is absolutely documented and useful for testing (for example emissions). // set channel to number between 0 and 100 int channel = 0; nrf_radio_shorts_set(0); nrf_radio_int_disable(~0); nrf_radio_event_clear(NRF_RADIO_EVENT_DISABLED); nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); while (!nrf_radio_event_check(NRF_RADIO_EVENT_DISABLED)) {} nrf_radio_event_clear(NRF_RADIO_EVENT_DISABLED); nrf_radio_mode_set(RADIO_MODE_MODE_Ble_LR500Kbit); nrf_radio_shorts_enable(NRF_RADIO_SHORT_READY_START_MASK); nrf_radio_txpower_set(0); nrf_radio_frequency_set(2400 + channel); nrf_radio_task_trigger(NRF_RADIO_TASK_TXEN);
- vbezhenar 2y agoThose proprietary implementations should not exist. Bluetooth is open protocol and there's no reason to not use open source implementations.
- rollcat 2y agoFrom TFA: > The ESP32 series of chips support open-source NimBLE and Bluedroid as Bluetooth host stacks. The undocumented commands in question (which implement the debug interface) are about to become documented, and Espressif was both transparent in their publication, and pledged for more transparency moving forward. How much more do you want?
- akimbostrawman 2y ago>How much more do you want? Be open (source) by default to prevent such issues from the start. A pledge does nothing, open code does.
- vbezhenar 2y agoI think that they handled this particular issue well. It was more rant about general state of things in the industry. I worked with Nordic chips and they also supply enormous 120 KB proprietary blob called SoftDevice which you supposed to put into your firmware and let it own all the interrupts. This is terrible experience.
- rollcat 2y agoI understand your objections, but I don't think I have to explain that anything directly touching wireless is already walking the edge of the regulatory abyss. But yeah, some vendors make it easier, others seem to just want developers to suffer.
- ChrisRR 2y agoJust because there are open source stacks, doesn't mean the radios implemented in silicon are open source
- blinkingled 2y agoVery clearly written article - didn't feel like they were trying to sell you their viewpoint - just laid down the facts concisely.
- solarkraft 2y ago> Espressif will provide a fix that removes access to these HCI debug commands through a software patch for currently supported ESP-IDF versions > Espressif will document all Vendor-specific HCI commands to ensure transparancy of what functionality is available at the HCI layer This is great. While this practice may be common and it may not be considered a backdoor, undocumented functionality is definitely a risk. I’m glad that people didn’t just take it as “well that’s how it’s done” but instead are pushing for a better way.
- deleted 2y ago[deleted]