|
|
Subscribe / Log in / New account

Matthew Garrett versus IPMI

By Nathan Willis
January 28, 2015

LCA 2015

At linux.conf.au 2015 in Auckland, Matthew Garrett gave a session about the security risks of the Intelligent Platform Management Interface (IPMI). IPMI is a largely a tool of convenience for administering server farms, and is implemented on supported motherboards as a feature that sits outside of the usual bootloader and operating system. It should come as no surprise, then, that it can be the source of serious security problems if is not prepared for properly.

Garrett began by reminding the audience of his previous experiences dissecting the security hazards of various four-letter words—namely ACPI and UEFI. Much like those examples, IPMI is an "out-of-band" feature: motherboard manufacturers implement it in a separate chipset without source code available, which makes it particularly challenging to insulate the main OS against.

Inside IPMI

Though related to ACPI, IPMI does have a different and reasonably well-defined use case. The underlying principle, Garrett said, is that data centers are awful places where no one wants to be: they are noisy, have nowhere to sit, the temperature is unbearable, and the phone reception is terrible. Thus, any technology that enables people to spend less time in their data center is perceived as good.

[Matthew Garrett]

That is the point of IPMI; it allows system administrators to monitor the health of their servers remotely and to troubleshoot problems—all without requiring access to the machines' OS. This is convenient for server hosting companies, where the customer expects the provider to maintain the machines, but usually not to interfere with the OS. The IPMI interface provides a serial terminal over its own network connection, so the host OS never even needs to know it is running.

90% of the time, the "management" boils down to rebooting the server, he said, since that solves most computing problems. IPMI simply lets administrators do so without having to walk all the way to the data center and back. The ability for a data center administrator to reboot a server even when the host OS does not want to reboot might be troubling—as could the fact that IPMI can tell the machine to boot from a different device (including network booting). But, Garrett said, the various vendor implementations are where things get truly "interesting" from a security standpoint, since vendors always want to add their own features beyond the specification.

Customizing the IPMI implementation is an attractive prospect for server vendors, he said, since it offers branding opportunities that cannot be removed, no matter what OS the customer installs, as well as the opportunity to incorporate various "value adds" to differentiate against rival vendors. Among the features server vendors add to IPMI are the ability to perform firmware updates, support for virtual hardware devices like a keyboard/monitor combination or CD drive, network service discovery, various web services, and what Garrett called "magic GPUs"—IPMI graphics adapters that can directly grab the contents of the server's actual GPU and make it available over the IPMI interface.

The magic GPUs and virtual hardware devices essentially allow the remote IPMI user to interact with the machine as if they were physically present—but bypassing the host OS entirely, with obvious potential for abuse by data-center administrators. The service-discovery and web-server features, in contrast, present potential attack vectors to people other than the system administrators who happen to be on the same network as the server.

Furthermore, IPMI is implemented on motherboards in a baseboard management controller (BMC), an embedded microcontroller that cannot be removed from the motherboard. BMC CPUs tend to be in the 600-to-800MHz range, Garrett said, with several megabytes of RAM. A variety of processor architectures are used, and almost all BMCs run Linux (with the notable exception of HP's, which run a specialty realtime OS).

The final piece of IPMI design that Garrett explained was the user-authentication scheme. The specification originally did not involve encryption at all, but it was updated in 2004. Now, it presents "a bewildering array of encryption and authentication protocols" from which to choose—but it still is not very good.

For one thing, he said, as part of the authentication handshake process, the BMC sends a hashed version of the correct password back to the user. Thus, all an attacker needs to do is guess one valid username, grab the hashed password, and run a cracking program against it. But even this is not always necessary, he added, since one of the options in the bewildering array is "Cipher Zero"—which, as the name suggests, involves no encryption or authentication at all. Luckily, he added, most vendors released an update to disable Cipher Zero, although not everyone has applied it.

Implementation details

The potential problems with IPMI and the various server-vendor–specific features are one set of threats, Garrett said, but another class entirely comes from implementation problems. Almost all IPMI implementations come from one of two vendors: Avocent (used in Dell, IBM, and Cisco machines) and AMI (used by almost everyone else). There is also a lot of common code shared between the two—for example, both use an embedded web server written by atWare and similar plugins. Bugs found in AMI's implementation of a basic feature tend to be found in Avocent's as well (and vice-versa). To their credit, he said, he has not yet found anything too egregious.

The server vendors' extensions, however, seem to be noticeably worse. They expose a lot of vulnerable interfaces, he said, such as CGI or PHP (the latter with extensions that allow embedded C code). They tend to leave a lot of services running, from SSH and Telnet to non-web GUI applications. Many servers support the Web Services-Management (WSMan) interface, which allows users to query server status with HTTP requests—and sometimes much more, like pushing new firmware. Garrett then referred the audience to firmware_config, a tool he developed for querying and setting firmware configuration options for a variety of IPMI-enabled server brands.

Garrett concluded with a tour of specific, egregious IPMI vulnerabilities he has encountered in the wild, noting that "you're here because you want to see me get really angry." The first example was from Dell's IPMI implementation: on that system, the IPMI console allows arbitrary command execution by appending commands as an "argument" to one of the real IPMI commands. So, for example, typing:

    firmware;/bin/sh

runs the firmware IPMI command, then gives the user a root shell. Another flaw involved the XML parser, which could be crashed and made to dump core by simply feeding it a set of tags in the wrong order, such as:

    </USERNAME><USERNAME>

Other commands, he said, are not written defensively—such as one instance of /sbin/pm that contained:

    "/bin/rm -f %s%s*"

which, he noted, might accidentally or maliciously be exploited to delete important files in certain circumstances.

It is very hard to "fix" IPMI implementations, Garrett said. BMCs are not removable and they cannot be switched off. They piggyback on motherboards' existing network ports and are configured to connect to the network at startup with DHCP. Furthermore, BMCs are fairly easy to discover, since they include SSL certificates that expose the server's serial number. Garrett offered an "educated guess" that scanning the entire IPv4 address space to look for server serial numbers in BMC SSL certificates could be done in well under an hour—gleaning around 100,000 servers. That information could be exploited by an attacker to track down owner information of all of the vulnerable servers.

The good news, he said, is that the industry has realized the problems with IPMI and is in the process of replacing it—although the replacement is not guaranteed to be better. In the meantime, Garrett advised server owners to put their BMCs onto a separate network, filter out all incoming IPMI traffic, and make sure all of the available updates get applied—quickly.

[The author would like to thank LCA 2015 for travel assistance to Auckland.]

Index entries for this article
SecurityFirmware
Conferencelinux.conf.au/2015


to post comments

IPMI ethernet port piggybacking

Posted Jan 29, 2015 8:55 UTC (Thu) by akanaber (subscriber, #23265) [Link]

The point about piggybacking on existing network ports was that if the IPMI implementation doesn't detect a cable plugged into the dedicated IPMI port it will (by default) provide IPMI "piggybacked" on a host network port, which it shares with the host OS. So if someone in the datacentre accidentally unplugs the wrong cable, you no longer have out-of-band management and instead IPMI coming up (and requesting an extra address by DHCP) on a network you've probably routed to the outside world. That really doesn't seem like a good default.

Matthew Garrett versus IPMI

Posted Jan 29, 2015 11:47 UTC (Thu) by bakterie (guest, #37541) [Link] (2 responses)

"Garrett advised server owners to put their BMCs onto a separate network"

I thought this is how it is supposed to be done?

Matthew Garrett versus IPMI

Posted Jan 29, 2015 15:17 UTC (Thu) by mjg59 (subscriber, #23239) [Link] (1 responses)

Supposed to be, yes. But often not.

Matthew Garrett versus IPMI

Posted Jan 29, 2015 17:35 UTC (Thu) by smoogen (subscriber, #97) [Link]

If you are lucky you can do so.. there is a TON of hardware out there which has the BMC listen on all interfaces no matter what..

Dear Dr Garrett, you are a braver man than I have ever thought. Looking at BMC and IPMI is like a travel into the Heart of Darkness via Innsmouth. The horrors I have seen... the HOORRRORRRS.

Matthew Garrett versus IPMI

Posted Jan 29, 2015 14:10 UTC (Thu) by Trou.fr (subscriber, #26289) [Link] (3 responses)

One of the first research work on IPMI security was published by Dan Farmer

http://fish2.com/ipmi/

a must read.

Matthew Garrett versus IPMI

Posted Jan 29, 2015 19:29 UTC (Thu) by martin.langhoff (subscriber, #61417) [Link] (1 responses)

Yes! This is good! It boils down to

1 - segregate IPMI at the network level, to a heavily restricted dedicated mgmt network
2 - reset IPMI settings when decommissioning, if there's no way to reset, destroy.

and

3 - we've discovered a huge number of hosts talking IPMI on the internet, from folks that didn't follow #1; and it seems that it is trivial to break into ~90% of them. don't let that be you.

There's a few more good items in there, but these are the salient points in my reading.

IPMI belongs together with your switch mgmt port -- in a physically segregated mgmt network. Anything else is madness.

Are there mad people in this world? Sure, but I doubt it's news... :-)

Matthew Garrett versus IPMI

Posted Feb 7, 2015 14:55 UTC (Sat) by tomgj (guest, #50537) [Link]

IPMI belongs together with your switch mgmt port -- in a physically segregated mgmt network. Anything else is madness.
Still sounds mad - they can all attack each other. We have a vlan per proprietary mgmt interface, with access mediated by management hosts which can see sets of those networks.

You don't run out of vlans: as long as you manage the scoping / trunking / topology properly, you can re-use the same vlan ids in different places as many times as you need.

Matthew Garrett versus IPMI

Posted Jan 30, 2015 13:12 UTC (Fri) by pabs (subscriber, #43278) [Link]

Some folks are collecting BMC related links here:

https://we.riseup.net/riseup+colo/foss-bmc-firmware

Matthew Garrett versus IPMI

Posted Jan 29, 2015 15:27 UTC (Thu) by intgr (subscriber, #39733) [Link] (3 responses)

Another example of bad design in the IPMI standards is that the host-to-BMC interface does not use interrupts. When the kernel sends a query to the BMC, it has to resort to polling to know when a response is ready. This has been known to cause 100% CPU utilization when the BMC crashes or "forgets" to reply: http://lists.us.dell.com/pipermail/linux-poweredge/2008-O...

Arguably the kernel should be written more defensively to assume that hardware is broken sometimes and limit the amount of busy polling, but people have tried to do that and AFAIK nothing has been merged. For example: https://patchwork.kernel.org/patch/13068/

Matthew Garrett versus IPMI

Posted Jan 29, 2015 15:49 UTC (Thu) by mjg59 (subscriber, #23239) [Link] (2 responses)

That's not strictly true, in the sense that the spec defines interrupt-based IPMI interfaces. But since basically everybody just implements the KCS interface, we end up in a situation of sadness.

Matthew Garrett versus IPMI

Posted Jan 29, 2015 17:40 UTC (Thu) by smoogen (subscriber, #97) [Link] (1 responses)

How many did you find were still using Linux 2.2-2.4 kernels in modern hardware? I had gotten a couple of motherboards from 2012 that showed up with kernels that were obscenely out of date by even that date time.

Matthew Garrett versus IPMI

Posted Jan 29, 2015 18:00 UTC (Thu) by mjg59 (subscriber, #23239) [Link]

The ones I've looked at were all 2.6, but yeah it wouldn't surprise me at all.

Matthew Garrett versus IPMI

Posted Jan 29, 2015 15:57 UTC (Thu) by ejr (subscriber, #51652) [Link] (2 responses)

For everything that's horrible about IPMI, the vendor solutions suck far worse. Every one with which I've dealt requires a precise version of 32-bit x86 Oracle Java 6.0. I'm terrified of their getting together and making a new "standard" management interface. They will have a basic level that provides nothing except possible power toggling, and that will be the checkbox on all contracts. Everything more will be vendor-specific, horribly buggy, insecure, and expensive.

*weep*

Matthew Garrett versus IPMI

Posted Feb 1, 2015 21:05 UTC (Sun) by wodny (subscriber, #73045) [Link]

And let's not forget about the great Supermicro Java applet launcher XML you have to patch before running:
http://www.p14nd4.com/blog/2011/09/30/solved-no-ikvm64-in...

Matthew Garrett versus IPMI

Posted Feb 2, 2015 12:53 UTC (Mon) by nix (subscriber, #2304) [Link]

Don't forget: they'll provide power toggling via an insecure implementation that allows complete access to the machine's FSB to any attackers. :/

Matthew Garrett versus IPMI

Posted Jan 29, 2015 17:45 UTC (Thu) by smoogen (subscriber, #97) [Link] (2 responses)

> It is very hard to "fix" IPMI implementations, Garrett said. BMCs are not
> removable and they cannot be switched off.

Some systems seem to have a BIOS setting of whether to enable network access for the BMC? I am guessing this is a dummy switch or just tells the BMC not to ask for DHCP?

Matthew Garrett versus IPMI

Posted Jan 29, 2015 18:01 UTC (Thu) by mjg59 (subscriber, #23239) [Link] (1 responses)

It may well disable network access entirely, but the BMC will still be running, so if you've previously been compromised it's not going to help much.

Matthew Garrett versus IPMI

Posted Feb 2, 2015 12:56 UTC (Mon) by nix (subscriber, #2304) [Link]

What's particularly nice is that, since they have to be running in order to power the machine on, they can't be switched off *at all*, even by switching the machine off. You have to physically pull out the power.

(One wonders if they're being rolled into the horrible Intel Management Engine these days -- y'know, the similarly non-upgradeable SPARC core running an OS closed to all except attackers without which your machine will not even boot.)

Source code?

Posted Jan 29, 2015 17:46 UTC (Thu) by faramir (subscriber, #2327) [Link] (2 responses)

So if most IPMI implementations are done with Linux, does that mean that the source code (for the kernel at least) is available? :-)

Source code?

Posted Jan 29, 2015 17:58 UTC (Thu) by mjg59 (subscriber, #23239) [Link] (1 responses)

Typically, yes

Source code?

Posted Jan 30, 2015 13:33 UTC (Fri) by pabs (subscriber, #43278) [Link]

I wonder if anyone ever succeeded in proving the provided artefacts actually are complete and corresponding source by rebuilding, installing and running them?

IPMI can only live on a secure network

Posted Jan 29, 2015 18:40 UTC (Thu) by martin.langhoff (subscriber, #61417) [Link] (5 responses)

IPMI, and anything in that space, must live on a segregated secure network.

It is a small os/firmware tied to the HW, the case for frequent updates is weak and the economic model makes it unsustainable. The qa-across-hw burden makes it unfeasible.

The only vulnerability worth discussing here is that in some cases it might be exposed to the network. That merits foghorns. The rest are good horror stories but inconsequential IMO.

IPMI can only live on a secure network

Posted Jan 29, 2015 19:03 UTC (Thu) by mjg59 (subscriber, #23239) [Link] (4 responses)

IBM BMCs are exposed to the host. Compromising the host means any vulnerabilities in the BMC then allow an attacker access to the BMC - and once they have the BMC, they have access to your segregated network. At that point it's of rather more than academic interest.

IPMI can only live on a secure network

Posted Jan 29, 2015 19:32 UTC (Thu) by martin.langhoff (subscriber, #61417) [Link] (1 responses)

Oh yes that's interesting. It wasn't clear in the article (or, did I gloss over it?).

How does that work? More details?

IPMI can only live on a secure network

Posted Jan 29, 2015 19:38 UTC (Thu) by mjg59 (subscriber, #23239) [Link]

There's a USB-ethernet device on the motherboard that hooks up to the BMC and provides access to the API endpoints. The rest is left as an exercise for the hacker.

IPMI can only live on a secure network

Posted Jan 29, 2015 20:48 UTC (Thu) by dlang (guest, #313) [Link] (1 responses)

It varies from system to system. On some systems it's a completely separate board with it's own NIC that connects to the motherboard. On other systems it uses a standard NIC on the motherboard that 'convention' assigns to this purpose (which can be accessed directly from the OS just like any other NIC). There have also been similar boards that had serial interfaces instead of ethernet.

In other words, so much depends on the particular version/vendor combination that it's impossible to generalize beyond the fact that they are all a mess and should not be trusted.

It's by far the best to have them plugged into a separate network, but I've seen banking companies who can't be bothered to do this (even when they already have a separate management network in place) and just plug them into the same network as the rest of the system uses.

IPMI can only live on a secure network

Posted Feb 2, 2015 13:04 UTC (Mon) by nix (subscriber, #2304) [Link]

It's impossible on some machines. My 2009-era Tyan-motherboarded server has two general-purpose NICs, a BMC, and no dedicated IPMI NIC. If remote access is on, it *always* rides over the general-purpose NICs -- and I see no reason to believe that it's not listening on them to some degree (and compromisable via them) even if remote access is off. After all, for firmware vendors, the assumption of competence is best reversed...

Is IPMI used in cars for remote update etc?

Posted Jan 30, 2015 13:12 UTC (Fri) by bokr (subscriber, #58369) [Link]

I could see the motivation, but imagine what could be
controlled in a self-driving car :-/ And before then, someone
may think it handy to be able to cut off ignition or other DOS.

BTW, is there any move to integrate BMCs onto SoCs, given that
different cores can be powered down or not independently?

Is there anyone issuing "Good Housekeeping Seals of Approval"
certifying exact verified full specs on computing stuff?
I'd sure like to be able to trust something.

IPMI vs NIST BIOS protection guidelines

Posted Jan 30, 2015 16:35 UTC (Fri) by jhhaller (guest, #56103) [Link] (1 responses)

I suspect that the BMC software writers are in the same league as the "crack-addled monkeys" thought to be writing BIOS code. NIST has a nice document which describes how to secure a BIOS. Three of the important steps are: the BIOS must be signed by the vendor; an older signed BIOS cannot be installed except as part of a rollback from an unsuccessful update; and when the BIOS is not running, that the BIOS be protected against changes. The first ensures that a random person cannot install their own BIOS with a vulnerability they have installed. The second ensure that an old signed BIOS with a known vulnerability cannot be reinstalled. The last one ensures that the BIOS can only be updated while running the BIOS, so that a booted program can't change the BIOS.

Allowing the BMC to change the BIOS is convenient, as no one wants to go into the data center, or even remotely, to update BIOS in a farm of servers, one at a time. The question is whether the BIOS update from the BMC meets all of the guidelines from the NIST document. If the BMC is able to update the BIOS while the system is operational, is the write protection from the main processor still effective? And, if the BMC can provide remote emulation of the console, does the BIOS know enough to not allow operations designated as requiring secure local access? Can BMC change allowed signatures for secure boot?

Updating the BMC itself should also follow almost all of the same requirements for BIOS protection, as changing the BMC is likely to enable all kinds of nefarious activities related to the questions in the previous paragraph.

IPMI vs NIST BIOS protection guidelines

Posted Jan 31, 2015 19:34 UTC (Sat) by giraffedata (guest, #1954) [Link]

I think a lot of software freedom advocates would have serious objections to machines with such restrictions on installing a BIOS. They believe it should be possible to legitimately own a motherboard to the extent that one can run any software on it one wants, as opposed to having it always partially owned by the person who manufactured it.

Maybe that concern could be reconciled with these excellent impediments to someone gaining illegitimate ownership of the motherboard by having some way to disable the restrictions via physical access to the board.

Matthew Garrett versus IPMI

Posted Feb 1, 2015 21:13 UTC (Sun) by wodny (subscriber, #73045) [Link]

Matthew Garrett mentions uploading a whole ISO. Actually from my experience on Supermicro boards the Java application emulated a CD drive and was sending blocks on request. In Wireshark it looked like no sensible authentication was done.


Copyright © 2015, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy