Red Hat UEFI Secure Boot patch for Linux kernel

Red Hat’s Product Security team is working with OSS-security to get a CVE listed for the below patch. Excerpting the OSS-security request from Wade Mealing of Red Hat, which was in turn paraphrased from Linn Crosetto, perhaps others:

When the kernel was booted with UEFI Secure Boot enabled, securelevel is set. If kexec (either through crash or admin action) is then used to load the same kernel, after reboot securelevel is disabled. In this state, the system is missing the protections provided by securelevel, for example kexec may be used to load an unsigned kernel via the legacy system call kexec_load. In the securelevel patchset, the state of UEFI Secure Boot is queried in the EFI stub, and sets a boot_params flag to indicate the state of UEFI Secure Boot. This flag is then used in setup_arch() to determine the correct state of securelevel. If the kernel is not booted via the EFI stub, securelevel is not set even if UEFI Secure Boot is enabled.

TLDR: this allows a bypass the security mechanism of securelevel/secureboot combination.

This patchset affects Red Hat specific kernels as secureboot is not fully fully implemented upstream yet.

It appears you need an account to view the bug database entry, and the patch:
Patch: https://bugzilla.redhat.com/show_bug.cgi?id=1243998#c3
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1243998

Android devices mostly insecure

Liam Tung has an article on ZDnet about Android device security (image from article):

Nearly 90 percent of Android devices are exposed to at least one critical vulnerability, because of Android handset makers’ failure to deliver patches, according to research from the UK’s University of Cambridge. Consumers, regulators, and corporate buyers face a common problem when assessing Android smartphones, in that no one knows which vendor will supply patches after Google develops fixes for Android security bugs.

http://www.zdnet.com/article/android-security-a-market-for-lemons-that-leaves-87-percent-insecure/

VMware UEFI updates

Three tweets from William Lam of VMware, with more information about new features (and one limitation) of UEFI, including a useful VMware UEFI article:

Excerpt from article:

For those of you who may not know, UEFI is meant to eventually replace the legacy BIOS firmware. There are many benefits with using UEFI over BIOS, a recent article that does a good job of explaining the differences can be found here. In doing some research and pinging a few of our ESXi experts internally, I found that UEFI PXE boot support is actually possible with ESXi 6.0. Not only is it possible to PXE boot/install ESXi 6.x using UEFI, but the changes in the EFI boot image are also backwards compatible, which means you could potentially PXE boot/install an older release of ESXi.

http://www.virtuallyghetto.com/2015/10/support-for-uefi-pxe-boot-introduced-in-esxi-6-0.html

 

NCCGroup Intel SGX primer

Back in January, Ollie Whitehouse wrote a very nice introduction to Intel SGX, with MANY links to related materials.

Intel SGX is a trusted execution environment which provides a reverse sandbox. It’s not yet available but those who have had access to the technology have shown some powerful applications in cloud use cases that on the face of it dramatically enhance security without the performance constraints of homomorphic encryption. However, there is enough small print to warrant both validation and defensive assessment activities when the technology becomes more generally available. There is a new set of features coming to Intel CPUs that have massive potential for cloud security and other applications such as DRM. However, as with all things that can be used for good there is also the potential for misuse. These features come in the guise of Software Guard Extensions (SGX). In this post we’ve collated what we know about the technology, what others have said about it and how it is being applied in real-world applications.

https://www.nccgroup.trust/uk/about-us/newsroom-and-events/blogs/2015/january/intel-software-guard-extensions-sgx-a-researchers-primer/

Windows Trusted Boot bypass

Microsoft: Trusted Boot Security Feature Bypass Vulnerability
CVE-2015-2552
Product: Windows NT series 8.0+
Affected versions: See “systems affected”.
Reported by: “Myria”

An attacker with administrative access to a Windows machine with UEFI Secure Boot enabled may bypass code signing policy checks by putting intentionally-malformed configuration options in the boot configuration database (BCD).

https://technet.microsoft.com/en-us/library/security/ms15-111.aspx

http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2552

http://seclists.org/bugtraq/2015/Oct/70

https://support.microsoft.com/en-us/kb/3096447

 

Interview with Andrew Regenscheid of NIST

I had an email interview with Andrew Regenscheid of NIST, one of the authors of the SP800 BIOS security documents.

Q1: Can you clarify NIST SP80-147’s reference to ‘golden images’ during various platform lifecycle phases? Specifically, does that imply source access to firmware, or is binary-only (‘blob’) ok?

A1: Golden Images

In SP 800-147 and SP 800-155 we end up referring to “golden images” a couple different ways.  They’re related, but a bit different. 

In SP 800-147, the idea was simply to store and use BIOS update images that you trust. The term “image” is perhaps a misnomer, as we were effectively just talking about saving BIOS updates from the OEM, which tend to include both the firmware image itself and the update utility.

We certainly weren’t imagining that you’d obtain sources.  We weren’t even imagining that you’d be able to cleanly separate the firmware code from the update code.

In SP800-155, we referred to golden measurements.  The idea here was to have “known-good” measurements for your firmware.  An easy example here would be the OEM telling you what you should expect to see in PCR-0 (in the TPM) for each system/BIOS version.  If vendors don’t supply this data, you could provision a couple boxes yourself and see what’s in PCR-0.  More generally, you could use other tools to do this from the OS (or a UEFI shell).  Obviously there’s security implications of taking these measurements from an untrusted environment like the OS, but it still might be a useful check. 

Q2:  What about the need for updating the trust in the keys baked into the keys? How does a system administrator verify the keys are still valid, using CRL/OSCP or other methods?

A2:
Key management will largely be driven by the OEM.  System administrators will simply trust whatever trust anchor is baked into the BIOS.  I wouldn’t expect most implementations to make it easy to find the trust anchor.  Theoretically, you might be able to find the public key that’s embedded in the firmware by searching the contents of the system flash, but that’s not going to be easy without knowing where to look.  There’s no API for that.

The idea of blindly trusting the embedded public key might be troubling to anyone that’s followed some of the security incidents at publicly-trusted CAs on the web.  But, I’ll note this is a very different use case.

Your BIOS likely just has a single public key embedded for verifying signatures on BIOS updates.  That key pair should be held exclusively by your OEM, and only used to sign
updates for its BIOS updates.  Your browser, on the other hand, has a couple hundred CA certificates, each of which could issue other CA certificates or web server certificates for any domain online.  The odds of a CA compromise or a need to revoke keys/certificates is much, much higher in the case of Web PKI.

That’s not to say we didn’t think about revocation for BIOS signing keys.  We thought about it, but ultimately decided the best way to revoke a signing key is simply to replace the public key in the next BIOS update.  How else would the BIOS get revocation information?  Online certificate status checking using OCSP seems impractical, since you’re not necessarily going to have network access from the BIOS layer.  Something like a CRL could work, but how would you download it, where would you store it, and how would you protect it?  

To support UEFI Secure Boot (which is completely different from signed BIOS updates), UEFI has its own key store.  That key store includes what is essentially a revocation mechanism (DBX- the forbidden signatures database).  DBX is intended to be updated from the OS, so revocation makes a bit more sense in that case.

You could imagine using something like the DBX for revocation of BIOS update signing keys, but it’s probably a lot easier simply to replace the trust anchor.

Q2.5 – Question on organizational control over BIOS updates

A: OEMs, as the source of BIOS updates, were the natural choice to sign updates, but we thought some organizations would want to authorize updates for their own equipment in addition to verifying those updates came from the definitive source.  To accommodate that use case, we discussed the idea of countersigning in SP 800-147.  The idea was that the OEM would sign the update, as well as the organization.  The update process would verify the authenticity of the BIOS update by verifying the OEM signature, and verify that is authorized by verifying the organization signature.  

Support for countersigning, or other mechanisms to allow organizations to authorize BIOS updates, was never a require part of SP 800-147.  However, we included it because we thought some end users in high-assurance environments would want that level of control.  For most organizations, I suspect the need for administrative access to apply a BIOS update is sufficient.  

I’m not aware of any major OEMs shipping products that support countersigning.  If they did, they would need to provide a way to allow end-users to configure a new trust anchor, and tools for countersigning BIOS updates.  End-users would be responsible for securely managing the signing key used to countersign updates.

Q3: What does it mean to say a vendor is ‘complaint’ to NIST SP800-147?

A3: Compliance

For a vendor to say they are “compliant” with SP800-147, all they really need to be able to assert is their BIOS implementation meets all of the “SHALL” statements in Section 3.1.  The guidelines also include a number of “SHOULD” statements, which are recommended, but not required.  For example, rollback protection is included as a “SHOULD” statement. 
Note that there isn’t a formal certification or validation process for testing that BIOS implementations meet the requirements in SP 800-147.   However, there are tools that can provide some assurances, like MITRE’s Copernicus tool, or Intel’s CHIPSEC tool.

Q4: If you could re-write SP80-147 today, how would you change it?

A4:
I’ve learned a lot about firmware security since working on the original SP800-147. Some of this came when we were rolling out BIOS updates across NIST when our OEMs started offering BIOS updates that added support for BIOS protections.  If I were writing SP 800-147 today, I think my guidance on managing BIOS (Section 3.2 in the current document) would be quite different.  I think it overemphasizes certain aspects of provisioning, and doesn’t emphasize enough the importance of applying BIOS updates.

Researchers are finding problems, and vendors are patching vulnerabilities.  But, a lot of people don’t seem to bother pushing out updates.  Why?  Because it is relatively complicated, compared to pushing out OS/app updates.  It’s gotten a bit better- you ought to be able to just push out a BIOS update utility using whatever patch management tool you have deployed.  Still, it isn’t done very often.

But, at this point I consider SP 800-147 quite stable.  We submitted NIST SP 800-147 to ISO SC27 for standardization under their Fast Track process.  It’s now an international standard as ISO/IEC 19678:2015.

Q5: One of the three NIST BIOS guidance documents is “DRAFT”. When might we see a final draft of that, and/or more BIOS security advise from NIST?

A5: Soon, I hope.  I know NIST SP 800-155, BIOS Integrity Measurement Guidelines, has been stuck as a draft for several years now.  I do intend to publish a final version, but before the document goes final I intend to put out a new draft that includes updates based on public comments on the 2011 draft, as well as new material for server architectures.  That should go out sometime early next year.

In addition, I’m working on firmware security guidelines with a broader scope than what’s in SP 800-147, which only targets the “system BIOS.”  There’s a lot of other security-relevant firmware in computer systems, and I’d like to see that protected as well.  We’re still in the early stages of this work, but I hope to get a new draft document out in the first half of next year.

 

End of email-based interview with Andrew. THANKS Andrew!

Note my comments on NIST ‘golden images’ were incorrect, I was thinking they needed blob-free full source, which is not what Andrew clarifies above.

http://csrc.nist.gov/

http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=65998

MMS2015: Terrell and Martin on UEFI

Mike Terrell and Troy Martin are giving a talk at the Midwest Management Summit (MMS) on transitioning Windows systems from BIOS to UEFI.

Making the switch from BIOS to UEFI

The Unified Extensible Firmware Interface (UEFI) is the next generation interface between the operating systems and the platform firmware.  UEFI replaces the legacy Basic Input/Output System (BIOS) firmware that has been around since the beginning of personal computers.  Although UEFI has been around for several years, manufacturers have provided support for legacy BIOS by the means of a Compatibility Support Module (CSM).  This allows support for booting from MBR-partitioned disks.  The downside to this old school booting method is that it is vulnerable to root kits and other intelligent types of malware that inserts itself into the booting process. In this session, you will learn the differences of BIOS and UEFI, the benefits of UEFI and Windows 10 security benefits that are only available when running UEFI.  How to use Configuration Manager to inventory systems that are running UEFI (as well as those that are not).  Also, you will learn about the common pitfalls when making the switch from BIOS to UEFI, how to avoid them, and how zero touch OSD is actually possible when making the switch.

http://mmsmoa.com/
http://mms2015.sched.org/event/a6243319bb0dcd3c631fda78c2763480

Mike Terrill on Windows 10’s Secure Boot and Cfg Mgr

Mike Terrill has an article on using Windows 10 and Secure Boot, and using Configuration Manager to show the state of Secure Boot:

Inventory Secure Boot State and UEFI with ConfigMgr

Now that Windows 10 has been released, you are probably starting to take a closer look at the new OS and the related security benefits that it has to offer.  Secure Boot is a supported security feature in Windows 10 that secures the boot process by only allowing the loading of drivers and boot loaders that are signed with a trusted signature.  The first versions of Windows to support Secure Boot were Windows 8 and Windows Server 2012.  Secure Boot requires computer systems to be running UEFI 2.3.1 (or later).  Legacy ROMs or compatibility support modules (CSM) must be disabled in order to enable Secure Boot. In this blog, I will show you how to extend the Configuration Manager hardware inventory so that you can report on the state of Secure Boot in your environment.  This will not only tell you which systems have Secure Boot enabled or disabled, but it will also help you detect systems that are not currently running UEFI (the ones running in BIOS mode).  Identifying these systems will be helpful when determining the deployment method that you will select when moving to Windows 10.  If it is a requirement of your security team that all systems running Windows 10 must also be running Secure Boot, it will give you an idea on how much effort will be involved during the deployment process. […]

Inventory Secure Boot State and UEFI with ConfigMgr

 

Second port of Tianocore to OpenPOWER

Check out the Comments section of the recent post on Tianocore being ported to OpenPOWER:

Tianocore for OpenPOWER

https://github.com/ozbenh/edk2

So there are TWO ports of Tianocore to OpenPOWER, and a few days ago I knew about neither of them.

I wonder if OpenPOWER will officially adopt UEFI as a firmware option for their platform. I’ve heard indirect bragging from IBM that their systems can be 100% fully open source firmware, no blobs.

Breaking Bad BIOS at Intel Security’s FOCUS conference

Intel Security has their annual FOCUS conference, in Las Vegas in a few weeks.

I may have missed others, but there is at least ONE interesting presentation at this event:

Breaking Bad BIOS — The Art of BIOS Attacks
Oleksandr Bazhaniuk, Security Researcher, Intel Security

Recent attacks against Basic Input/Output Systems (BIOSs) attracted attention due to their ability to enable stealthy and highly persistent malware capable of compromising software applications, operating systems, and hypervisors. Some can bypass secure OS boots, enable attacks on encrypted disks, and even allow additional malware installs.
 * Understand current BIOS attacks and attack surfaces
 * Understand platform level tools and mitigations
 * Observe an actual attack demo

http://focus.intelsecurity.com/Focus2015/SessionsSessionSchedule.aspx

Top 3 IoT Threat trends

The IoT news site M2Mnow has an article by Benny Czarny of OPSWAT, discussing the top 3 IoT threat trends, and one of these 3 trends is firmware:

Trend # 3. Increasing firmware hacks

Another trend that we are seeing is firmware hacking: the process of installing rogue firmware on embedded devices. Cisco recently warned customers that hackers are replacing the boot firmware on devices running Cisco’s IOS operating system with a malicious version. The attackers install the malicious version to prevent reboots from wiping IOS infections. Now that Point of Sale systems (POS) have gone mobile, these too have become a target for hackers. Although the possibility of firmware hacking has been known for some time, actual real-world attacks have been rare until now.

Full article:

http://www.m2mnow.biz/2015/10/12/37820-top-3-trends-in-todays-threat-landscape/

 

Tianocore for OpenPOWER

Andrei Warkentin has ported UEFI to OpenPOWER! Excerpt from readme:

TianoCore UEFI for OPAL/PowerNV (PPC64/PowerPC64 Little-Endian)

This is “UEFI” on top of OPAL firmware. “UEFI” because the specification doesn’t include PowerPC yet (ever?). At some point this experiment will implement reduced-hardware “ACPI” support, mapping the OPAL-based FDT into “ACPI” structures. “ACPI” because it’s also not specced out for PowerPC. It’s getting prototyped on top of QEMU and Skiboot (OPAL firmware).

Why? It’s thought experiment gone too far. In short, there’s IMO value in presenting a common firmware environment shared with other servers (X64, AARCH64). UEFI+ACPI keep the OEMs and IHVs in their comfort zone, and reduce pointless platform boot and configuration variance across different architectures. It also allows plug-in cards to work (assuming EBC ROMs). Petitboot is a nice idea in theory, but in practice it’s probably more suitable to embedded environments rather than whitebox servers that can compete with Intel boxes. UEFI gets us a bootloader environment and device drivers for I/O and booting via storage and networking. OPAL is the abstraction layer for the machine.
[…]

https://github.com/andreiw/ppc64le-edk2
http://osdevnotes.blogspot.com/

Running OPAL in qemu – the powernv platform


http://github.com/andreiw/ppc64le_hello

USB Killer

Dark_Purple has an article on Habrahabr.ru on an interesting device, a ‘USB killer’, the v2 version. Excerpt of Google Translate:

Finally we managed to organize the installation and testing of prototypes of a new version of the device. Devices that perform only one function – the destruction of computers. But let’s not limited to computers, the device is able to incapacitate almost any equipment equipped with USB Host interface. For example, I have on the table is an oscilloscope with USB interface (but it is still useful), almost all smart phones support USB OTG mode, TV, routers, modems, etc. The main feature of the new version of the device is increased twice, “output” voltage, it is now 220 (strictly speaking, minus 220). Also in the new version the efforts were aimed at making the device even more compact, as in the first version had slightly modifying the body, so that everything fits. The principle of operation is not changed. Connecting to the USB port starts operation of the voltage converter, which charges the capacitor to 220V. By achieving this voltage converter is switched off and the stored up energy in the capacitor is supplied to the signal lines USB interface. After the capacitors discharge cycle is repeated.

https://translate.google.com/translate?sl=ru&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F268421%2F

Multiple Netgear wifi routers vulnerable

Compass Security has an advisory for multiple NETGEAR wireless routers as reported by Daniel Haake:

Product:   Netgear Router Firmware N300_1.1.0.31_1.0.1.img and N300-1.1.0.28_1.0.1.img
Vendor:    NETGEAR
CVE ID:    requested
Subject:   Authentication Bypass
Risk:      High
Effect:    Remotely exploitable over LAN/WLAN

Multiple NETGEAR wireless routers are out of the box vulnerable to an authentication bypass attack. No router options has to be changed to exploit the issue. So an attacker can access the administration interface of the router without submitting any valid username and password, just by requesting a special URL several times. The attacker can exploit the issue by using a browser or writing a simple exploit. […]

Full advisory:

http://www.csnc.ch/en/downloads/advisories.html
http://www.shellshocklabs.com/2015/09/part-1en-hacking-netgear-jwnr2010v5.html
http://www.csnc.ch/misc/files/advisories/CSNC-2015-007_Netgear_WNR1000v4_AuthBypass.txt

Weak passwords

I saw this ‘thread’ on Twitter:

https://twitter.com/harribellthomas/status/651794474394361856

and it reminded me of something similar I’d recently read in a vendor’s IPMI whitepaper:

“Special characters like #,$ are not allowed into password field, as these characters can enable shell injection from intruders. Use strong passwords that are at least 8 characters long and include a mix of numbers, capital, and lower case letters.”

Scary. Check your vendor’s password limitations, make sure they’re not limited.

Luca Hall on writing Cisco IOS rootkits

As announced on PacketStormSecurity, Luca Hall of Grid32 has written an article on Cisco IOS rootkits:

Writing Cisco IOS Rootkits

This paper is about the work involved in modifying firmware images with the test case focused on Cisco IOS. It will show how it is a common misconception that doing such a thing involves advanced knowledge or nation state level resources. I think that one of the main reasons people think it’s so difficult is because there are no commonly known papers or tutorials that walk the reader through the entire process or give all the resources necessary in order to end the paper with a working rootkit. This paper will change that. This paper will provide sound methodologies, show how to approach the subject, and walk the reader through the entire process while providing the necessary knowledge so that by the end of the paper, if the reader is to follow it completely through, they will have a basic but functional firmware rootkit.

PDF is here:

https://packetstormsecurity.com/files/133917/Writing-Cisco-IOS-Rootkits.html