10

How can the average user easily validate the integrity of their Mac's firmware?

Before you downvote this question or lecture me on how I am paranoid and no one should ever need to do that, please read below.

In July 2015, CVE-2015-3692 revealed that a Mac's EFI firmware could be hacked by a remote attacker. (The vectors available for this are in other CVEs, but could hypothetically be anything, including things like malicious fake Flash update installers.)

This vulnerability was made public at least four weeks before Apple patched it on July 30 for OS X 10.8, 10.9, and 10.10 with EFI Firmware Security Update 2015-001.

The same security researcher who announced this vulnerability also claims to have seen a demonstration at a conference of a firmware hack that cannot be removed or overwritten.

Therefore, once a Mac's EFI has been owned, if the attacker did it right, then the only way to reflash the EFI with valid Apple firmware would be to wire up a reflasher directly to the EFI chip on the logic board itself (do not try this at home).

News articles that reported this vulnerability downplayed it, saying that most users should not worry, and all you need to do in order to protect yourself is never let your Mac go into sleep mode, and either disable the root user, or never authenticate anything you do not 100% trust. Comment threads on those articles summed it up like this: if all your apps come from trusted sources like the official App Store, and you never run anything that's not code-signed by developer known to Apple, then you should have nothing to worry about.

But then in September 2015 we learned about the XCodeGhost exploit, which is known to have resulted in numerous malware-infected apps showing up on the official iOS App Store—but what about OS X apps? In the linked article, Malwarebytes wrote:

Wardle pointed out back in March that Xcode was vulnerable to this sort of thing, but frighteningly, also pointed the finger at many other OS X apps. Any of those apps could be vulnerable to similar attacks.

They also wrote, "the average user should not panic"—the same mantra that I often see parrotted on the Apple support forums and elsewhere anytime a user posts a thread about tons of weird problems they are having. "Just reformat your drive and perform a clean install of the system. The problem is likely a third-party system modification," we are told. When that doesn't fix it, people are told it must be a hardware problem, like a failing HDD, failing GPU, or bad RAM. I've seen threads where people replaced literally every component in their Mac, and the problem would always come back.

Now we know it's hypothetically possible that users' EFI firmware got hacked—so even if their motherboard was replaced, when they'd reinstall their apps, the firmware could just get reflashed again by the malware! And if the motherboard was not replaced, then they'd be hosed no matter what.

That brings me back to the main question.

How can the average user easily validate the integrity of their Mac's firmware? I.e. how can you check to make sure your Mac's firmware has never been compromised by malware? I could not find any method compatible with El Capitan that does not require disabling SIP. For prior OS versions, there is a complicated third-party tool called DarwinDumper that can dump your EFIs contents to a text file, but you still need to have the valid Apple firmware to compare it against—this is not a method that the average user is capable of doing.

Telling people not to worry about something they very well could be the victim of, and have no way to check if they are, is what enables these sorts of exploits to be profitable for hackers, who depend upon complacency and a lack of vigilance on the part of users.

==

EDIT: I found the latest official Apple firmware installer on Apple's support site. The installer doesn't run on 10.10 or 10.11, oddly. Using Pacifist I extracted the .scap file for my Macbook Pro 9,1. I compared the binary in HexFiend with the biosdump that I pulled using DarwinDump after rebooting into Recovery Mode and running csrutil disable on terminal to disable rootless and enable the ability to run unsigned kexts. I recovered this BIOS header:

   $IBIOSI$   MBP91.88Z.00D3.B0B.1506081214Copyright (c) 2005-2015 Apple Inc.  All rights reserved.ˇˇˆ´5µ}ñÚC¥î°Îé!¢é_i@Ÿ¯¡Apple ROM Version
   BIOS ID:      MBP91
   Built by:     root@saumon
   Date:         Mon Jun  8 12:14:35 PDT 2015
   Revision:     svn 39254 (B&I)
   Buildcave ID: 6
   ROM Version:  00D3_B0B

The official BIOS from Apple's header:

   $IBIOSI$   MBP91.88Z.00D3.B0B.1506081214Copyright (c) 2005-2015 Apple Inc.  All rights reserved.ˇˇˆ´5µ}ñÚC¥î°Îé!¢é_i@Ÿ¯¡Apple ROM Version
   BIOS ID:      MBP91
   Built by:     root@saumon
   Date:         Mon Jun  8 12:14:35 PDT 2015
   Revision:     svn 39254 (B&I)
   Buildcave ID: 6
   ROM Version:  00D3_B0B

Other than that the files are very different-looking, but I'm guessing the .scap file has some sort of compression. At least that tells me I had the latest firmware installed, the one that was released after the hacks were announced. I'm prolly good. Would be nice to be able to confirm I'm good through some kind of checksum verification however! Looking at you, Apple!

4
  • 2
    Is this a (rather well-researched) question or a feature request? If it is a question, can you please strip it down a bit to put more focus on what you are looking for ("how can an end user verify firmware integrity")?
    – nohillside
    Commented Oct 6, 2015 at 8:38
  • Question. The part I am looking for is in bold and is repeated twice and is the title. I rely on readers to install more RAM in their brains or take ritalin if the supporting details are a "problem".
    – CommaToast
    Commented Oct 6, 2015 at 9:35
  • 2
    Nevertheless you could improve matters by turning your edit (at the end of your question) into a first answer (with probably some more details about how the casual user can perform the necessary steps). Also if you want Apple to listen(and I think they should) a feature request is the better way still :-)
    – nohillside
    Commented Oct 6, 2015 at 10:01
  • I don't want Apple to "listen"... I want them to be a different kind of company than what they are, and that's never going to happen unless they hire me as "awesomeness assurer"
    – CommaToast
    Commented Oct 18, 2015 at 2:10

4 Answers 4

3

To check the firmware of an Intel UEFI system, such as a Mactel, boot Intel LUV (Linux UEFI Validation) distro, luv-live, run Intel CHIPSEC. It'll check for most of the publicly-known firmware vulnerabilities. You should run CHIPSEC when you first get your box, save the ROM, then occasionally re-run CHIPSEC and compare the ROMs for changes. You can use UEFItool, CHIPSEC, or UEFI-Firmware-Parser, or a handful of other tools to a forensic examination of the ROM.

For some more information about the topic and the tools involved, see my slides for a presentation I gave recently.

1
  • Also, there's a project called Firmware Vault that collects Apple ROMs, which might be useful to study as well.
    – Lee Fisher
    Commented Oct 10, 2015 at 16:58
3

The title of “how can an average user” is a bit of a danger zone, since I don’t consider anyone that uses Terminal average - not passing judgement, just that the audience here is way above average to even know they should validate firmware. Hopefully I’m not sounding too pretentious with this short summary of what I think the average mac user should do:

The macOS installer updates firmware when you install / reinstall the OS, so simply booting to recovery and reinstalling the current version of macOS, you will not lose any programs, settings, data and get a chance to ensure your firmware is up to date. Even if you installed the OS several months ago - if newer firmware is around when the installer checks while getting ready to install, you’ll get that update as part of the exercise.


If you’re not able or willing to just run an install, then it becomes much more tricky to report / validate you’re really up to date. I suppose it depends on why you think you didn’t get the updates as part of the normal upgrade / update process. Since there’s no general check on all the firmware, I would say the average user cannot validate firmware and even exceptional users are having difficulty performing the level of analysis required. Average users struggle with the difference between authentication and authorization. Expert users find it tedious to verify checksums and cryptographic chains of trust and human nature is we don't do those activities well, even in well engineered, well motivated, well supported environments.

I would open a support ticket with Apple for each instance where I wanted to verify firmware and participate in the official Apple Security Notifications mailing list so you're in the loop when things change.

I'm sorry if this isn't the answer you wanted, but I also felt this was my small entry into an answer to everyone that sees your question and wonders how to start on learning. As more users ask apple for support, eventually knowledge base articles will be written. At some tipping point, funding would be added and the problem would be engineered to match the user education levels. We're just in the early days from where I see things.

1

Just an update to this question since a new program is available..

It's called eficheck. It's in the /usr/libexec/firmwarecheckers/eficheck directory aka probably not in your path, so it's a little more complex than some others but there is a man page for it that documents its usage.

Its important to consider that anything modestly sophisticated enough to get into your EFI is likely going to be able evade detection to some degree. That's a lot of the reason antivirus checks are useless, although the people who regurgitate "antivirus checks are garbage" have no clue as to why and are repeating the conclusion someone smarter than them drew which is that antivirus companies tend not to know have the ability to properly analyze Mac specific malware so they are not adding a file's unique hash value to their database so your computer can compute the hashs of its own files then those against a database of known malware hashs. Almost all virus scans do nothing more and don't look for malacious behavior.

At the end of the day though Apple's EFI is Intel's UEFI so you're trusting Apple to do something correctly that is really complex and technical. Apple can't even figure out their own PKI and have you ever seen the developer manual for an Intel processor? It's thousands of pages of ancient greek. I mean come on you didn't think Apple was pretty and smart, did you?

The security mailing list is a simple notification when updates are released and nothing more. You would be in the loop for new patches to long identified and easily exploited CVE-IDed issues affecting the latest OS and older ones aka the ones in use. There's nothing to prevent future exploits in the updates..at least that they will mention ever due to their policy not to speak of such things. The only security items addressed will be to say that a very specific issue has been fixed by the update.

If they did identify a "malware attack" (it didn't stick around after?), it'd violate their own policy if they were to confirm it and report back to the user as well as be a poor business decision since many of their customers still don't believe in malware. Notice it says nothing about contacting the user or fixing the problem. Could see the headlines now.. All of the bad press lately has been really bruising their ego and seems like its approaching a tipping point.

0

Just as an update, macOS 10.13 High Sierra will automatically verify the integrity of a Mac's firmware once a week. If a problem with the firmware is found, your Mac will offer to send a report to Apple. A post by The Eclectic Light Company says this about the reports;

If you are running a real Mac, rather than a ‘Hackintosh’, Kovah asks that you agree to send the report. This will allow eficheck to send the binary data from the EFI firmware, preserving your privacy by excluding data which is stored in NVRAM. Apple will then be able to analyse the data to determine whether it has been altered by malware or anything else.

AppleInsider says this as well;

The report sent to Apple excludes data stored in NVRAM. Apple will then look at the transmitted data to evaluate if there has been a malware attack

Check here to learn more about this new feature: macOS High Sierra Automatically Performs Security Check on EFI Firmware Each Week

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .