start	end	text
0	980	All right.
980	3120	This is a talk about bare metal, though.
3120	4840	And for cloud providers.
4920	6620	So metal as a disservice.
7120	10840	And here is Bill Demirkepper.
15740	19800	Thank you so much, everyone, for coming out again for another one of my talks.
19800	22600	I'm really excited to be back here at DEF CON.
23000	32600	And, yeah, today I'm going to be talking to you about a wave of systemic vulnerabilities in these new cloud providers that have a machine learning focus.
33700	43220	So for some background, my name is Bill Demirkepper and I'm a security researcher with a background in hardware and software as well as the web and cloud.
43400	48920	I'm really passionate about security research that I can have an impact at scale.
48920	56480	And recently I've been working on automating vulnerability discovery with advancements and foundation models for code reasoning.
58620	63140	Today we're going to be going through a little bit of background to set the scene.
63140	72640	What are bare metal servers and what is the rise, what do I mean by the rise in providers that are intended to support machine learning workflows?
72820	82280	We're going to go through the attack surfaces that bare metal servers are subject to as well as a few case studies before wrapping it up with a review of our lessons learned.
84960	93200	So for some background, there is a lot of large providers out there like AWS, Azure and Google Cloud you're likely aware of.
93260	96320	And in terms of volume, their market share is massive.
96320	99640	It's not even comparable to a lot of these smaller providers.
100280	113500	But what we started to see in the past few years as interest in machine learning has grown, is the rise of these new or rebranded providers that offer competitive pricing for GPUs.
114040	118000	Again, in terms of volume, they're nothing compared to these large providers.
118260	126720	But if you're working in this space, you may be familiar with some of the names on the right because they offer competitive pricing sometimes at a tenth of the cost.
129330	134630	Now, what is a bare metal server compared to a regular VM?
135010	138070	Well, we can separate it into three categories.
138190	141270	Bare metal means you're running directly on the host.
141730	143370	You, you're running on metal.
143370	146330	There's no layer between you and the host.
146330	152330	Whereas, for example, with virtual machines, there's a hypervisor between you and the host itself.
152330	161030	And while that can provide some security guarantees, in the case of machine learning workloads, that can also sometimes impact performance with PCI devices.
161610	163650	Another version is containers.
163650	172730	Think Docker, where you still run on the host OS, but you're in, inside of a little container where you can't really do anything except interact with the GPU.
173310	176270	We're going to be focusing on the left, bare metal.
179750	185450	Now, one of the big selling points of bare metal is supposedly greater security.
185630	194430	If you take a look, I have a few vendors here who claim that, you know, bare metal cloud servers are physically isolated from other servers.
194690	200010	Um, there's discussions about performance, better control and improved security.
200150	208690	And while this may be true in theory, what we're going to explore today is how in practice, you're really at the mercy of your provider.
212120	218700	So, there's been a lot of research in the past decade into boot security as well as hardware security.
218700	225140	But in large, a lot of that focuses on either client devices or individual servers.
225400	231580	What I've found is that there's limited bare metal cloud research, particularly against these modern providers.
231720	238780	You know, established monoliths like the AWS's of the world have invested over a decade into their hardware security story.
238980	250560	When I was first getting into machine learning a few months ago, before I started renting out GPUs, I was curious to make sure that the security story was at least somewhat okay.
251140	254880	And that's exactly what I did, um, in spring when I had this need.
254880	260460	I decided to start renting GPUs and taking a look at these environments that I had access to.
261380	265080	So let's go through the attack surface problem with bare metal servers.
266060	268540	By design, you have root access.
268540	272440	Now, that's, we've seen that with regular VMs as well as containers.
272440	275980	But the difference is, is that this is one of the main selling points.
276060	278980	You have root access to the actual hardware.
280240	284180	And unfortunately, this can expose significant attack surfaces.
285700	291420	So for example, we have the Eufion BIOS, you know, boot time attack surfaces from the, uh, motherboard firmware.
291420	298400	Any vulnerabilities in your firmware, such as during network boot, could be exploited by an attacker on the local network.
299080	304500	We have onboard devices that offer a point for persistence.
304660	314840	You know, a NIC or GPU are examples of privileged components where if compromised, they can access your host machine even after you've released the server to another customer.
316020	321660	We also have firmware of motherboard and onboard devices for being backdoored.
321660	323920	And again, for persistent access.
323920	334860	If the provider doesn't do a great job of resetting the machine between customers, there's a possibility that an attacker can actually infect the host and maintain persistence for long to come.
335920	340080	There's also the baseband management controller, the BMC.
340080	342700	This is what enables out of band server access.
342700	345960	It's how providers actually manage your server.
346700	350520	It's responsible for cleaning environments between tenancy changes.
350520	353300	But if this is compromised, you're out of luck.
353300	358360	Because at the end of the day, the BMC has nearly full control over the host machine.
359300	361900	And finally, we also have the network.
362380	367500	You may be exposed to other customer servers if there's improper isolation.
367860	377240	And as a result, this can expose critical flows like provisioning, which may allow an attacker to gain code execution while your server is being set up.
377840	385540	What we're seeing here is that we are pretty much dealing with a traditional firmware and hardware security attack surface with any device.
385540	389820	But it can have way worse consequences because it's in a shared environment.
390000	395420	Remember, you're borrowing someone else's server in a data center with hundreds of other servers.
396080	399620	A lot of firmware and hardware attacks depend on physical access.
399620	402820	But with bare metal cloud, that's actually not the case.
402820	405560	Because you have root access by design.
407340	411380	Now, how do bare metal cloud providers actually manage these servers?
411620	416600	One of the most popular implementations I've seen is canonical's metal as a service.
417260	420320	The BMC allows management of a single server.
420440	438720	But in order to provision hundreds of servers in a data center automatically, where you're not dealing with VMs or a hypervisor, mass allows you to automate a lot of the process for provisioning, you know, up deploying a custom operating system, as well as deploying any specific customer specific scripts or configurations .
439960	451600	Now, what's really interesting about mass, when I was first reading about it, is that it relies on nearly two decade old protocols, such as Pixyboot, in order to provision devices.
452840	456300	Keep this in mind as we continue through this presentation.
456880	465100	From a high level, mass starts by booting into an environment for provisioning using Pixyboot.
465100	482340	Pixyboot is a way of booting from the network where your device makes a DHCP request and the DHCP server, in this case, the mass management server, responds with a specific boot image in order to load scripts that will retrieve your customer data, deploy any custom scripts,
482340	483760	and so forth.
484900	499480	The high level flow looks like new, commissioning, ready, and at this point, when it reaches the ready stage, this is where the BMC is configured, and at this point, it can be deployed to the customer.
500660	504820	Users can use mass API in order to control the device.
504820	511400	So, the provider might have a web UI and mass is really what's controlling all these servers and providing metrics under the hood.
511820	514800	Let's dive into these attack surfaces.
516080	525240	So, starting with the boot environment, bare metal servers often lack basic defenses like secure boot because, again , the point is customer control.
525360	533200	It's not that secure boot was very secure anyways, but it effectively makes it even easier to hijack the boot process.
533740	538100	So, remember how mass was using Pixy or network boot.
538120	540120	Well, let's take a look at what that looks like.
540120	543040	On the right, I have two boot options.
543040	545320	The top one is for booting from a hard drive.
545320	547040	This is an NV RAM variable.
547040	550860	And the bottom one is a second boot option for booting from the network.
552240	555480	This provides an interesting opportunity to corrupt the boot chain.
556440	567840	Remember, the way that mass works is by when the device starts, it will go request a mass server, hey, give me a Pixy boot image and this is the point in which provisioning scripts are deployed to the server.
568800	578120	So, one really interesting way I found of persisting on servers without touching disk is by creating a malicious boot option.
578880	583860	Pixy boot requires a local DHCP server, generally speaking.
583860	593140	But if firmware also supports modern network boot, we can specify a remote server in the boot option through something called HTTP boot.
593480	595420	You can see on the right a device path.
595420	598040	That is what your boot option would look like.
598040	614980	And what you can effectively do is specify that on the default boot path is that you need to make first get an IP address over DHCP, but instead of requesting Pixy boot, you instead request a remote server, EFI image from your attacker server.
615620	624020	And this has been in the EDK2 open reference code for firmware, UEFI firmware for over a decade.
624020	629820	And if you have Pixy boot, chances are that HTTP boot is supported as well.
631300	639480	And one really cool primitive around this that I found was that we can weaponize UEFI security features to protect our persistence.
640020	645060	So UEFI allows you to create something called authenticated variables.
645400	651860	This is typically used to secure policy variables like the signature database as well as a platform key.
652060	658000	But a lesser known feature about UEFI is that you can create private authenticated variables.
658600	665280	So what an attacker can do is that they can create a boot option that is protected with their key.
665920	674840	If you don't have direct firmware access, in order to remove that boot option, you would need or otherwise modify it, you would need to sign a payload with that key.
675620	686880	As a result, an attacker can make it really annoying to change the boot order back to normal or reset configuration, even if they don't have direct access to the device during decommissioning.
690710	708210	And if you want to change BIOS options but you don't have console access, another trick you can do is that AMI and other independent BIOS vendors, so these are the vendors that basically create a base framework that UEFI firmware is built on top of.
708930	716870	What they allow you to do is there's automatic open source tools to parse BIOS options in hidden UEFI variable structures.
716970	722430	Now these are undocumented but these tools will effectively tell you this BIOS option is at this offset.
722890	738670	And as a result, if there's any time you run into an issue where you can't access the BIOS but you want to change maybe a security feature, you can use these tools to discover the offsets to these undocumented structures in order to downgrade the security of the environment even further.
739890	753730	While these variables that contain the setup options are often no runtime access and what that means is after you exit boot and you go into the operating system, the operating system cannot directly modify these variables.
753890	769230	There's a lot of other opportunities you can use such as booting from a custom EFI image on next boot just by changing the boot order and writing a simple nearly hello world EFI application in order to directly set these variables and the offsets that you're interested in.
769650	778790	If you're interested in more, learning more about BIOS hacking, there's great forums out there like WinRaid and Bad Caps that have a lot of discussion on this exact topic.
780990	782910	Moving on to the BIOS.
783670	791450	What I've noticed is that there's a lack of user friendly tools to inspect the end to end boot security story.
792270	796690	We'll go over some of the utilities out there that solve part of the problem.
796690	802150	But what I've consistently discovered is that there is nothing that covers the entire thing holistically.
803370	811490	So starting with basic enumeration, just some simple Linux commands, you can install DMID code which is going to dump some BIOS data.
811490	815690	This is useful for understanding just details about your environment.
815690	817250	What type of server are you running on?
817250	819150	What type of motherboard are you running on?
819150	820750	What is the BIOS version?
821510	829090	There's also the boot EFI path which has the default EFI partition and this contains your boot loaders and any configuration files.
829430	836950	What I mentioned about modifying BIOS options with your own EFI image, this is where you would put your EFI image and then you just have to change your boot order.
837570	842870	There's also the sys firmware path which allows you to interact with various firmware information and settings.
843270	851460	And this is honestly this, one of the first things I do whenever I get onto a new bare metal cloud provider is just this basic enumeration to figure out what I'm dealing with.
852240	859740	Another really useful utility is Chipsack and Chipsack is effectively a framework for analyzing platform security.
860580	868720	Once you compile and run it, it'll give you a bunch of detailed information about common vulnerabilities found in bare metal environments .
869800	881360	It's not comprehensive in the sense of it still has little gaps here and there but it's one of the best utilities for just getting a quick picture about how, about the posture of your platform.
882280	894320	You can see on the right some of the things it checks for is Intel's manufacturing mode, it'll check if the BIOS is writable, is it protected and it also explicitly tells you when there's something wrong.
894320	898980	Like when there's a vulnerability, it'll tell you why it's critical and how you can actually exploit.
900280	906920	Now, one of the defenses against tampering with the BIOS is called Intel Boot Cart and this is specific to Intel machines.
907560	913820	This is a security feature that effectively establishes a route of trust from Intel to OEM firmware.
914340	920200	If you're considering modifying firmware on a bare metal server, this might be one of the things you have to look after.
921040	930440	Now, if it's applied incorrectly or often not at all, it may allow an attacker to modify your firmware and actually put an implant for backdoor persistence.
931260	945960	And if specifically manufacturing mode is left enabled or the end of manufacturing is not reached, which effectively means the OEM keys have not been fused into the chipset, this likely means you can disable Intel Boot Cart.
947640	949220	How do you know if it's enabled?
949220	960140	Well, if you dump firmware using a couple different routes, one of them is through Intel's CSME utilities, think flash programming tool, it can be hard to find the right version for your chipset.
960340	966880	There's also IBV specific tools, like if you're running an AMI motherboard, there's AFU Linux for Linux.
966940	972380	And chipset also, for example, has a built in ROM, SPI ROM dumping capability.
972600	977360	Once you have your firmware, you can open it up in a utility called UFI tool.
977360	985660	And if you see these colored regions here on the left, yellow means it's partially protected, and then red means it's definitely protected.
985900	993420	This can be a quick way for you to explore what parts of your firmware are going to be under scrutiny, under being checked for their integrity.
993820	1000180	It's, it might be worth actually exploring some of the unprotected volumes for opportunities to inject code.
1001000	1004840	On the AMD side, there's something called AMD ROM armor.
1005220	1012660	This is a near equivalent to Intel Boot Guard, and like Intel Boot Guard, it provides integrity of the SPI flash firmware.
1013320	1017400	I'm going to be honest though, empirically, it's rarely secure in practice.
1018940	1020240	How do you know if it's secure?
1020240	1025200	Well, there's this great open source utility just like Chipset called PlatBox from IOActive.
1025900	1032980	This allows you to do basic audits of your environment, and it has a few features that are quite capable with AMD devices.
1033640	1040600	Nearly every machine I've tested with AMD and PlatBox, usually has one or two big problems in them.
1041200	1046440	And one of the other cool parts about PlatBox is it also enables flash access, including read and write.
1047360	1058340	So, let's say that you do have flash access, and you can write to firmware, you don't, you're not dealing with signature verification, or maybe the module that you're replacing is not in a protected region.
1058460	1060360	What does that actually look like?
1060640	1069840	Well, the UEFI tool, specifically version 0.28, allows you to actually replace parts of the UEFI firmware with your own image.
1070660	1079780	Now, there's some tutorials on BIOS modding forms in order to, for example, like change modules or remove certain modules to unlock certain capabilities.
1079880	1087700	But personally, my favorite has been game, the game hacking community recently has published some really cool work around, for example, backdooring SMM.
1087780	1091040	And there's open source projects that have full tutorials.
1091040	1099300	If you're interested in learning more about how to actually backdoor a UEFI firmware image, this project SMM Infect is a great place to start.
1100640	1112130	For example, we can replace an unutilized SMM image with a malicious EFI driver that allows us to maintain persistence after we've released our bare metal server to another customer.
1113570	1122570	So, you know, we've discussed firmware persistence by modifying boot options and executable code, but how do you actually defend against this?
1122570	1130070	Well, the real key is that you need to make sure to re-flash nearly every part of your device whenever you're provisioning between customers.
1130070	1137590	When I let go of my customer server and if I had bare metal access, you should go ahead and reset the BIOS to a stock image.
1138270	1140870	Now, the how actually depends on your hardware.
1140870	1144510	And this is one of the tricky parts about being a bare metal cloud provider.
1144810	1156670	So, some of the larger providers like AWS, et cetera, they have these platform resiliency chips that can not only reset firmware as needed, but can even detect tampering as it happens.
1157150	1161710	Some BMCs also have similar capabilities, but it's really up to the provider to use them.
1162270	1169350	For example, BMC Redfish interfaces are a way for you to access the BMC through a programmatic manner.
1169350	1186930	But even if they offer the firmware reset or update capability, if you don't use it and if the provider doesn't use it, then there's nothing stopping an attacker from backdooring your firmware, releasing the server, and then letting another customer unknowingly use a compromised server.
1187670	1196810	OpenStack Ironic, a mass equivalent, does offer the capability to reset firmware automatically as part of the cleanup flow.
1196810	1205930	But as far as I'm aware, mass itself, which I've seen in several bare metal cloud providers, does not have a default automated cleanup flow for firmware.
1208620	1215160	One of my favorite primitives for exposing vulnerabilities in protected code is downgrading to an older version.
1215280	1224700	Let's say that you're dealing with an environment where you just can't figure out Intel boot guard, AMD ROMer, ROM armor, or whatever it may be, but you want privileged access to firmware.
1224800	1236980	What you can do is that you can use traditional flashing techniques, but instead of using a firmware with your malicious module, you first downgrade the BIOS to an old version that has vulnerabilities.
1237360	1240640	This is a technique I've seen work time and time again.
1240940	1248000	It's extremely effective and it's a great way to escalate your privileges from, for example, the operating system to the boot environment.
1248160	1253760	And it still passes Intel boot guard and AMD ROM armor because the code is still signed.
1253760	1255500	You're executing legitimate code.
1255500	1256720	It's just vulnerable.
1257200	1261100	Now these features do technically have anti-rollback capabilities.
1261100	1264720	For example, Intel has something called secure version numbers.
1264720	1268220	But empirically, no OEM uses them in practice.
1268220	1277900	You know, what they should do is when a new vulnerability is discovered and there's an update released, they bump the secure version number and this prevents downgrading to an older version with the vulnerability.
1277960	1282920	But again, it's, it's very inconsistent, rarely used in practice by major OEMs.
1284960	1290800	Now, moving on, another risk to bare metal servers is PCI devices.
1291280	1296860	Let's say you do a great job of resetting the BIOS after a server has been decommissioned.
1297020	1303040	Well, one of the other things you have to worry about is the devices that are attached to your host.
1303300	1309200	This includes your GPUs, your CPU config devices, the BMC, network adapters and so on.
1309780	1312360	Again, this is pretty easy to enumerate on Linux.
1312360	1318360	You know, there's LSPCI, the SysPCI path and dev to see what sort of devices you have access to.
1318620	1330000	And just to give you an example here, on the right we can see that this bare metal server I was testing has two broad, uh, broad com controllers and they're controlled by this BNextEN driver.
1331080	1342480	The reason this is really useful is because if you go over to the Linux source code and take a look at the driver, you can often find remnants of critical functionality like the ability to flash the adapter.
1343200	1358080	So, for example, if you were interested in backdooring a PCI device such as a NIC, you can go ahead and look at the driver and often it'll include functionality to flash the NVRAM and that's a great place to start if there aren't open source utilities already available.
1358400	1365800	In this case, broad com, uh, adapters that use this driver can actually be dumped using Ftool.
1368220	1374520	A real critical problem with these PCI devices is that they can come with something called an option ROM.
1374780	1380520	So these are EFI drivers that enable interoperability between the PCI device and the host.
1381040	1386560	It's part of the device's flash and if there's no root of trust, it is prime for a backdoor.
1386560	1393260	The reason is, instead of just replacing, for example, the NIC's firmware, the option ROM is loaded into the host.
1393460	1395860	Just like any other EFI driver.
1395960	1406620	So, if you can replace it, it offers a really convenient way for you to maintain persistence and without having to do any firmware hacks to take over the host by other means, such as DMA.
1407680	1413380	Now, de, decommission flows like OpenStack Ironic may reset the BIOS.
1413380	1418640	But resetting the firmware of these onboard devices is rare outside of large providers.
1419420	1423540	There is some silver lining there, like some OEMs like Dell and HP.
1423540	1428420	They have at least a basic root of trust for components that come with the server.
1428880	1436800	But outside of that, it's really rare to see providers, especially the ones that are starting out, to do any of these secure practices.
1437020	1442400	Just to give you an example of what this looks like and what option ROM backdoors may look like.
1442400	1446780	There's this great project from a decade ago called Thundergate.
1446780	1458240	And one of the really cool parts about it is that the scripts allow you to replace Broadcom's firmware with not only your own firmware, but also an option ROM that is loaded into the UEFI environment.
1458380	1464660	If you're interested in tampering with Broadcom adapters and specifically option ROMs, this is a very great place to start.
1464660	1466940	And it's something that I use throughout my research.
1470070	1474150	Now, GPU firmware is a little bit of an interesting special case.
1474650	1480050	NVIDIA GPUs embed several microprocessors based on a custom architecture known as Falcon.
1480330	1486350	Starting with the Maxwell architecture, Falcon microprocessors enforce a root of trust.
1486350	1489110	This means that GPUs need to be signed.
1489870	1501270	Now, GPU modding forms have made some progress in tampering with the firmware, including cross flashing firmware from, for example, a GTX 1070 and porting that over to a 2070.
1501290	1504290	But it still requires a valid signature.
1504750	1512270	Unfortunately, in terms of tampering with the GPU, if you're using NVIDIA, um, your backdoor opportunity is limited to a supply chain.
1512270	1516070	So if you were selling a GPU to a data center, there may be an opportunity there.
1516070	1524270	But in terms of backdooring a bare metal server's GPU, it's going to be difficult unless you can get around this firmware signature verification system.
1525350	1529750	Now, most of the attack surfaces we covered require specialized tooling.
1529750	1531850	But where do you actually find them?
1532010	1535090	Well, you can look at the target vendors, public utilities.
1535130	1544390	But nowadays, a lot of vendors, I don't know, like Supermicro, what they'll do is that their tools will enforce signature verification, even if technically it's not required at all.
1544490	1550450	There are some leaks on BIOS modding forums like WinRaid and BadCaps, and you can look on virus scanning platforms as well.
1551090	1556070	And on the right, you can see an example of looking for open directories with specific Intel utilities.
1556070	1560530	But my favorite has been scraping OEM driver packages.
1560710	1564370	So, for example, let's say you want to go get a Dell driver.
1564370	1571070	Instead of just stopping at that driver, write a script that will download every single Dell driver ever released.
1571230	1579990	Extract those zip files, and I guarantee you, you will find very interesting leaked utilities just left in some driver packages on accident.
1580590	1590790	For example, below is a script that just vibe coded for Supermicro that allows me to enumerate every public utility and actually download the zip files.
1590790	1602490	And this is how I was able to get certain tools that allowed me to flash the BMC without actually needing to run into the firmware verification problem that the new equivalent tools had.
1604550	1609150	Moving on to the BMCs, so this is again the heart of your data center server.
1609150	1615610	It enables remote management and monitoring, and it's going to be independent of the operating system and the CPU.
1616170	1619750	You can see a diagram below from CloudFlare that kind of discusses what this looks like.
1619750	1624730	But effectively, it's a chip on your server that allows the server to be managed remotely.
1624750	1634270	And even if the actual host is powered off, if the BMC is turned on, because it's kind of like a tiny PC inside of your server, it allows full management.
1634270	1636770	For example, you can access your KVM console, etc.
1637130	1643910	And what I found is that this is actually a prime target for finding vulnerabilities in order to backdoor your device.
1644490	1652290	It requires significant time investment, but if you're willing to put in the time, almost always there is some issue that allows you to backdoor the firmware.
1653290	1661410	So, for example, if the BMC exposes itself to the host, in order to enumerate it, you can use utilities like IPMI config and IPMI tool.
1661630	1667590	On the right, you can see a command where I dumped the BMC config for one of the servers that I was granted access to.
1668110	1676130	And if you want to find easy, low-hanging fruit, look for proprietary customizations on top of the base code.
1676130	1679390	So, think, for example, Asus.
1679390	1687110	Asus may use Megarax as a base, but Asus will add a bunch of customizations on top of this base BMC firmware.
1687210	1697570	And that code, because it's specific to Asus, is far more likely to contain vulnerabilities, whereas the BMC underlying code does still contain vulnerabilities, but it's going to be looked at far more.
1698230	1707050	Just to give you an example of interesting features that I've discovered is there's proprietary undocumented commands to reset a BMC to stand stock.
1707050	1711070	And if you can do that, well, you can just take over it because it has default credentials.
1711210	1727970	And you really have to go to Google and look into the documentation for these, but I found multiple instances whereby sending a undocumented IPMI tool command, you can just reset it to stock and at that point you have admin access through the default credentials and you can reset the BMC firmware to largely whatever you want,
1727970	1730150	depending on the firmware verification present.
1731530	1740670	So, depending on the configuration, the BMC may also allow host or out of band control through something called the keyboard controller style or serial over LAN.
1740670	1744110	These are known as KCS and SOL channels.
1744490	1746450	Some tools offer greater access at boot.
1746450	1754790	So, if you execute a Eufy shell and you run some of these tools, it'll allow you to interface with the BMC with greater capabilities than the OS tools allow you to.
1754930	1763190	And similar to the whole modifying BIOS options trick from earlier, you can write a startup script for a Eufy shell to run commands and exit.
1763730	1769470	A diagram below shows kind of all the complexities and different ways that you can interface with the BMC.
1769730	1775450	And each one of these are a great opportunity to look into by default, does it allow access?
1775450	1778170	And if so, what is the privilege level of that access?
1779210	1788530	Another really important point is that just because the official tool from a vendor says that you can't modify firmware, that doesn't mean you can't modify firmware.
1788770	1801630	In this example, I was dealing with a server where the official tool, the Gigaflash X64, told me that my modified and backdoored BMC firmware did not match the BMC firmware signature verification mechanism.
1801830	1817810	But when I found another vendor's tool for the same BMC chip, the AST25000, what I found was that I was, I could easily flash the target chip because at the end of the day, the signature verification I was seeing was just client side.
1817990	1825390	So again, target vendor may enforce restrictions in their flash tool, but another vendor's equivalent for the same chip may not.
1826910	1829710	And not all BMC firmware is created equally.
1829750	1841070	For example, what I mentioned earlier around whether your BMC has signature verification, well, for one of the servers I was dealing with, which was an X11 super micro server, I found something interesting.
1841070	1845170	Where the firmware was signed, but technically it wasn't really enforced.
1845490	1857070	So here, super micro's documentation says that for these X11 and H11 generation systems, super micro has added the capability to cryptographically sign the software.
1857290	1864310	But you keep reading and you realize, wait a minute, because of backwards compatibility, it's not enabled by default.
1864310	1865930	It's not actually stock at all.
1865930	1873110	And it's just an example of just because you see firmware signature verification doesn't mean that it's actually there in the first place.
1873110	1879590	In this case, what you could do is you can downgrade it to an older version of the BMC firmware that has a vulnerability.
1879710	1887310	Or you could also largely use these other vendor tools to take over the flash without having to worry about signature verification in the first place.
1888630	1892910	So again, firmware assigned, flash with a valid but vulnerable version.
1892910	1896550	And look for vulnerabilities in other vendors who use the same BMC chip.
1896750	1903790	Just as a few examples, binarily has found several vulnerabilities inside of super micro's BMC software.
1904130	1919630	So for example, even if you are dealing with a super micro environment that has signature signed firmware, you can downgrade it to an older version before 2024 and you may be able to actually abuse these vulnerabilities in order to flash it again with your own image.
1921350	1928350	Moving on, another serious risk to these bare metal environments and one of my most favorite turned out to be the network.
1928910	1933690	Bare metal servers are subject to a similar threat model to that of any data center server.
1933830	1936010	Except it's way easier to get access.
1936110	1941930	You don't need to phish anyone, you don't need to compromise an employee and then pivot onto the data center network, whatever it may be.
1941930	1944790	This is by design root access to data centers.
1945430	1950590	And network is critical to everything from provisioning, management and potential cross tenant access.
1950590	1954150	So any issues in the network layer are bound to have a critical impact.
1954610	1965110	Just to give an example, I was pretty shocked to see that trivial wire shark and promiscuous mode would capture traffic from other client servers even though I wasn't doing anything fancy.
1966090	1971250	This showed that there wasn't even a basic segmentation or isolation.
1971470	1982470	But moving on, even if there was some basic isolation of network traffic, because let's say that the switch remembers what MAC address is associated with what port, et cetera.
1982570	1985010	Well, what about traditional ARP soothing?
1985090	1987830	It turns out it actually works extremely well.
1987830	1994830	I was again, just very dumbfounded by the networking security that I was dealing with, with these bare metal cloud providers.
1994830	1999510	Again, these are the top providers in the machine learning space that offer the most competitive pricing.
1999550	2009030	Most of them were unfortunately actually vulnerable to basic network vulnerabilities that reminds me of like two decades ago, Cain and Abel style attacks.
2009230	2016250	We'll see specifics in the case studies, but this was a really interesting find that opens the door to a few interesting attacks.
2016790	2020170	Again, another classic simple pen test red team trick.
2020170	2022510	You know, you can scan the internal data center network.
2022510	2024370	Look for a low hanging fruit.
2024410	2037170	And sometimes you're behind a VLAN, but if this is enforced at the bare metal host that you have root access to, which in the cases I saw VLANs was, then it doesn't really matter because you can easily bypass it.
2037750	2042650	Besides the data center's infrastructure, you can also scan other customer servers.
2042650	2046470	So let's say that you apply firewall rules at the gateway.
2046470	2053890	So in your, let's say provider's firewall web UI, you block all ports except, you know, 22 or whatever it may be.
2053890	2065730	Well, if I'm on your internal network, what I actually found was I was able to access significantly more surfaces than the customers had intended to expose based on the internal network access compared to the external network public IP.
2066250	2080550	Just to give you an example, the screenshot below is from an NMAP scan of an internal data center network where I found a lot of low hanging fruit like, you know , a decade old vulnerable SSH, um, daemons as well as IPMI access and so forth.
2080550	2089630	Again, if you're dealing with a bare metal data center network, it's really worth checking the local network whether you can hit other servers as well as the data center's internal infrastructure.
2091010	2107310	Now, one really, really cool attack that I found was when I was renting this bare metal Mac mini to test its inferencing capability, I noticed this Wi-Fi symbol at the top bar and I found that not only could I enable Wi-Fi, but the data center had an open network for visitors.
2108150	2112730	So this wasn't visible when I was renting a Mac mini from, for example, AWS.
2112930	2119570	Um, for what I understood, AWS actually appears to have disconnected the Wi-Fi PCI device, um, in hardware.
2120190	2126590	Uh, but what I found was in this case, not only was it just as simple as clicking the toggle, but they had an open network.
2126770	2134230	And it was really, really cool to find that Mac OS, their Wi-Fi, uh, NICs actually allow for something called monitor mode by default.
2134230	2142190	So this allows you to not only intercept a traffic, for example, on your open network, but it allows you to see what's going through the air.
2142270	2143790	And these are the raw frames.
2143790	2155550	So for instance, the previously, these locked networks you see down below, the, I saw multiple authentication like EAPOL, if you're familiar with WA2, WPA2 cracking, et cetera.
2155550	2163190	This was a really interesting way of going from like, you know, a, a remote attack scenario to a physical data center attack surface.
2163390	2173610	Um, and the reason I didn't include this in the case study sections is because once I hit the open network, I was a little too scared to continue on exploiting devices there because the data center wasn't owned by the provider.
2173610	2175830	They were just reselling that data center's network.
2175970	2179930	Um, and I did try cracking the WPA2 EAPOL handshakes.
2179930	2191410	Fortunately, it wasn't anything in any normal dictionary, but I still found this just as a really unique, uh, attack vector that bare metal servers can introduce to your data center, uh, that I haven't seen discussed before.
2192550	2197330	So going to mass again, remember how it uses those decade old protocols?
2197330	2202350	Well, again, pixie boot over DHCP and HTTP for their provisioning API.
2202350	2208670	It's a great opportunity for you to go from an insecure network environment to cross tenant RCE.
2209070	2212910	So what we're discussing here is not technically a mass vulnerability.
2212910	2218610	This would require your data center or your provider to have insecure network segmentation and isolation.
2218790	2225850	But mass does make it pretty easy for you to take advantage of these provider weaknesses as we'll soon see.
2226570	2233350	Another interesting fact I found about these mass servers is that they expose a squid HTTP proxy by default.
2233510	2237710	So this is used for like caching, for example, APT packages, et cetera.
2237790	2252470	But as an indirect result, even if you were isolated from other servers on your network, but you were exposed to the mass server because your server needs to be able to provision and get config, yada, yada, you can actually tunnel through the mass servers HTTP proxy in order to,
2252470	2254730	for example, hit other servers on your network.
2254730	2263750	Like I, I wrote a very simple Python tool that use this HTTP proxy to try to do a port scan of the local network just by like HTTP connect style.
2265450	2269270	And to make requests to the mass API, you need these provisioning keys.
2269270	2273750	Um, and this is basically when a service first starts, it'll send its Mac address to mass.
2273890	2277570	And if the Mac address is recognized by masses, Hey, I'm provisioning the server.
2277570	2279570	That's where you get these provisioning keys.
2279570	2289230	But if you're already on an environment where you want to look at the mass API, what you can do is you can take a look at the local var lib cloud folder and look for this object pickle file.
2289350	2291090	It's the secret for it.
2291090	2299310	Mass is not typically stored elsewhere, but in these pickle files, you'll find them in plain text and you can extract them in order to attack the mass API itself.
2299670	2317110	And it's another interesting primitive that I found was that if you need a Mac address of another server on your network being provisioned, there's actually a race condition where you can go ahead and race the registration process where you claim to be this Mac address and you receive the provisioning keys instead of the real server.
2317570	2327470	In practice, what this means is that if a customer had, for example, specified custom credentials, let's say a password, or maybe they had their own scripts that runs at initialization.
2327830	2336890	What this would allow you to do is access those customer config and scripts otherwise and, for example, get access to customer specific API credentials.
2339860	2341980	Let's move on to a few case studies.
2344660	2351680	So, again, one of the most simple vulnerabilities that I discovered was just promiscuous mode on bare metal servers.
2352000	2359920	In this case, this vendor, I was seeing traffic from other servers without actually having to do anything special like ARP spoofing or anything like that.
2360120	2367620	You know, one of the really interesting things I saw on the network was these DHCP offers from the gateway when servers were being provisioned.
2368000	2384640	You can take a look on the right as one of these packets, but what it allows us to really do is because we can see the DHCP offer as well as the request on the network, when we detect one of these DHCP discover requests, we can respond with a malicious pixie,
2384640	2391300	malicious pixie URL and server and feed the server our own EFI image to execute at boot.
2391320	2396880	This is a way for you to go from, again, a network vulnerability and to remote code execution.
2397600	2405040	Another attack here is when you detect that DHCP discover, you register on that server's behalf and get access to customer config.
2405040	2414360	If you see DHCP traffic on your bare metal provider's network without doing ARP spoofing, this is a great attack to go from, again, the network to RCE and information disclosure.
2419280	2431300	So, moving on to ARP spoofing, there is another vendor where I wasn't actually able to detect much traffic besides miscellaneous broadcast through just promiscuous mode alone.
2431300	2436660	But, by ARP spoofing the mass gateway, I suddenly started to see this massive flood of traffic.
2437180	2455720	An attack you can do at this point, if you're, if the other servers believe you are the mass gateway, well, you can hijack EFI images that are requested from the mass server, instead of spoofing a DHCP response or an offer or whatever it may be, you instead just man in the middle of the actual mass server and,
2455720	2469780	again, since mass uses these two decade old unencrypted protocols, they allow you to take advantage of this network and security, and instead of, for example, serving the real boot x64 EFI image, you serve your own backdoored image that allows you to get code execution.
2471400	2475760	Now, one of the really special cases I found was with RunPod.
2475900	2479840	Now, they're a new, fairly new provider, but they're still pretty popular in this space.
2480120	2486460	They don't offer bare metal hourly rentals, but rather containers, so Docker containers with GPU access.
2486460	2492980	You know, they have this community cloud for random people running servers, but I was taking a look at their secure cloud of vetted data centers.
2493240	2501880	So what I found was that by trace routing from their servers, I found that they were reselling, likely through a bulk contract, through a provider known as Mass Compute.
2501880	2505620	And what would you know, Mass Compute allows you to do hourly rentals.
2506540	2513600	As a result, I found that, uh, I could do the ARP spoofing, again, get access to the DHCP traffic.
2514000	2524620	Um, but one of the really cool things that I found was that by doing this DHCP spoofing and ARP spoofing, um, I found traffic for, related to RunPod's customers.
2524620	2535980	So again, I compromised Mass Compute, but as a result , because RunPod, a container environment, uses Mass Compute, they're inherently exposed to their providers' providers' vulnerabilities.
2536180	2543780	On the left, you can see an unencrypted traffic between nodes for Caltech's machine learning training runs.
2544080	2551460	On the right is other unencrypted traffic related to logs from Mass, uh, RunPod's managed inference service.
2551460	2556380	And you can see their Docker containers and, and Docker, uh, container names, et cetera.
2556380	2562980	And, and just, again, this is a really special vulnerability because it's, RunPod itself wasn't offering bare metal in the first place.
2563660	2572660	Now, the reason I called out RunPod is because they were also one of the only providers to actually address the vulnerabilities in time for this talk and, um, I want to give them credit for that.
2572660	2579620	They did respond extremely quickly and as far as I'm aware, they've isolated customer networks from Mass Compute's other customers.
2582020	2585860	So, to take, so review for a few takeaways here, shy level.
2586100	2593360	What we need to do, eh, from large providers or takeaway from large providers is that you need to reflash all devices, not just your BIOS firmware.
2593360	2596820	You need to physically disconnect unnecessary PCI devices.
2596820	2599280	Think that Wi-Fi adapter on the Mac minis.
2599300	2601060	You need to isolate the network.
2601060	2603640	That is one of the most critical things you can do.
2603780	2609460	Because at the end of the day, if your network is compromised, it's the easiest path to cross tenant compromise.
2609620	2617200	For example, I discussed a few attacks that I tried with BMC backdoors and NIC backdoors, but those all require significant time investment.
2617260	2622220	The network was really one of the most simple attacks I'd done for an insane impact.
2622680	2628340	Now, you can also look into custom firmware and attack surface reduction, but getting the fundamentals is even more important.
2629060	2631400	And at the end of the day, don't use legacy BMCs.
2631400	2634340	Use the ones that have firmware verification, et cetera, built in.
2634400	2637660	Um, and even then realize that you're not going to be completely protected.
2638680	2644680	So, lessons learned here, bare metal just has a number of impossible to deal with attack surfaces.
2644680	2650740	These large providers have spent nearly a decade investing into the hardware and boot security story.
2652820	2666300	Virtualize may be actually better than bare metal in terms of security, because yes, bare metal may be more secure if implemented properly, but what we've seen here is that bare metal wasn't implemented properly throughout the board, especially with these new providers.
2666300	2669800	And as a result, the security story is far worse than if you just use a VM.
2672430	2674550	So, what do you do to protect your organization?
2674730	2678310	Well, first of all, don't believe in confidential compute.
2678310	2681010	That's one of the things I've recognized in the last few months.
2681010	2685270	It is just complete BS, at best a deterrent.
2685350	2689410	No matter how many times these large providers try to sell you on it, don't listen to them.
2690390	2695050	You, honestly, what you should recognize is that we're not important enough to be targeted by some of these attacks.
2695050	2702430	And so, it's probably okay to actually use these hourly rentals, even from potentially vulnerable providers, because are we really going to be targeted?
2702430	2703930	Well, maybe, maybe not.
2703930	2705570	Is our workload really that important?
2705670	2706570	Probably not.
2706770	2713130	You know, one thing you can do if you have a spare kidney or two, is you can go ahead and buy, you know, eight GPUs of your own and build your own server.
2713130	2714450	That's what I decided to do.
2714450	2724150	But I actually did it largely because I wanted to be able to experiment really quickly and not because of, for example, security reasons, even though that is a side benefit.
2724970	2729890	For future research opportunities, I'd love to see more research into GPU PCI access.
2729890	2733550	You know, what can you do in a container with GPU PCI access?
2733750	2735990	What about network vulnerabilities in virtualized environments?
2735990	2742490	Are there any opportunities like some of the attacks we saw today for inside of containers or other virtualized VMs?
2742570	2746810	And finally, can we automate the discovery of these systemic vulnerabilities?
2746810	2752430	A lot of this had to be hand done and really frustrating, but I'd love to see more automation around it.
2752530	2755370	Anyways, thanks so much for coming out.
2755490	2759870	We're out of time for questions, but you can find me outside in the hall right after if you have any.
2760090	2764510	And yeah, if you miss me, feel free to DM me on Twitter with any questions as well.
2764510	2765510	Thank you so much.
