|
|
Log in / Subscribe / Register

Cracking Linux with the backspace key?

By Jonathan Corbet
December 21, 2015
Anybody who has been paying attention to the net over the last week or so will certainly have noticed an abundance of articles with titles like "How to hack any Linux machine just using backspace". All this press does indeed highlight an important vulnerability, but it may not be the one that they think they are talking about.

The source of these reports is a mildly hype-ridden disclosure of a vulnerability in the GRUB2 bootloader by Hector Marco and Ismael Ripoll. It seems that hitting the backspace character at the GRUB2 username prompt enough times will trigger an integer underflow, allowing a bypass of GRUB2's authentication stage. According to the authors, this vulnerability, exploitable for denial-of-service, information-disclosure, and code-execution attacks, "results in an incalculable number of affected devices." It is indeed a serious vulnerability in some settings and it needs to be fixed. Unfortunately, some of the most severely affected systems may also be the hardest to patch. But language like the above leads reporters to write that any Linux system can be broken into using the backspace key, which stretches the truth somewhat.

It is worth looking at what is required to actually exploit this vulnerability. The conditions are:

  • An attacker must have physical access to the system's console to be able to type the famous backspaces. In general, once an attacker can actually put hands onto a target system, the game is already lost. That is no excuse for a trivially exploited vulnerability in the bootloader's authentication code, but it does add a bit of perspective. Note that you may have physical access to the Linux-based entertainment system in your airplane seat, but you almost certainly lack access to the console.

  • The attacker must be able to reach the bootloader's authentication prompt. That generally means being able to force a running Linux system to reboot so that the bootloader actually runs. If the system is configured to allow unprivileged users to cause a reboot, then complaints of "denial of service" are already moot; service can be denied at any time. Of course, that can also be done by pulling the plug since, as has already been noted, the attacker has physical access to the system.

  • The system must be running the GRUB2 bootloader. If it's an x86 system, chances are that it is indeed GRUB2 that is installed there. Other architectures tend to use other bootloaders, though. Many of the embedded systems that might be most at risk from this type of vulnerability will thus not be running the vulnerable software.

  • The bootloader must actually be configured for password-based access. While lacking hard data, your editor would guess that a small minority of systems booting with GRUB2 have passwords set on them. In most cases, simply rebooting allows full access to the bootloader and its capabilities — no exploit required.

  • The system must be running an exploitable version of GRUB2. This part is relatively easy — the vulnerability has been present since version 1.98, released in late 2009.

Given the above, it seems unlikely that this vulnerability has exposed "any Linux system" to attack. Instead, it has exposed a small number of systems that are configured with bootloader security, but that also allow physical access to a console keyboard. For some of those systems, this vulnerability constitutes a true emergency. For most of us, though, there is no particular need to go into red alert.

There is a different vulnerability that has been exposed here, though, that is somewhat more severe. Anybody who reads the mainstream technical press now "knows" that any Linux system can be broken into by pressing a single key a few times. Linux security has been exposed as a laughable joke; how can anybody take such a system seriously?

In other words, all it takes is a couple of researchers who are able to turn up a bug, create a logo and a cute name ("Back to 28" in this case) for it, and post it as a "zero-day vulnerability" to create a storm of mocking bad publicity for Linux. Relative to, say, the Juniper firewall backdoor, disclosed at about the same time, the GRUB2 issue is minor indeed. But "28 backspaces" makes for good headlines, so it may well be that more people know about the GRUB2 vulnerability than the "unauthorized code" in security-critical Juniper products. It's bad enough when, as happens all too often, we are justly lambasted for security problems affecting large numbers of users; to be taken to task for this one is just kind of sad.

Arguably, we have just seen an exploit of a vulnerability in our public-relations system: any attacker with a "zero-day" bug and some minimal marketing skills can cause untold damage to the image of Linux as a whole. Companies deal with such issues by firing up their own PR machines, but Linux does not really have any such thing. So we are stuck trying to patch up our reputation after the fact, hoping that at least some members of the press will eventually figure out that, in fact, you really can't hack into any Linux system by hitting the backspace key.

Index entries for this article
SecurityBootloaders


to post comments

Cracking Linux with the backspace key?

Posted Dec 21, 2015 15:58 UTC (Mon) by stqn (guest, #103999) [Link]

Excellent article, thank you. I will only need to copy-paste the URL to anyone who believes the FUD…

Cracking Linux with the backspace key?

Posted Dec 21, 2015 16:42 UTC (Mon) by spender (guest, #23067) [Link]

The "researchers" involved in this have a history of over-hyping their findings (and in some cases spread just plain factually incorrect information) -- see all of their previous publications regarding ASLR:

http://hmarco.org/cyber-security/attacks/bypass64bitsASLR...
http://hmarco.org/bugs/linux-ASLR-integer-overflow.html
http://hmarco.org/bugs/AMD-Bulldozer-linux-ASLR-weakness-...

None of the reported issues affected grsecurity/PaX.

Speaking of, they have a new talk scheduled for BH Asia 2016 entitled "Exploiting Linux and PaX ASLR's Weaknesses on 32-bit and 64-bit Systems":
https://www.blackhat.com/asia-16/briefings.html#dr-hector...
Which again spreads false information about PaX by lumping in its ASLR implementation with upstream's, and is very likely hyping up some rare exploitation scenario as a generic attack, and almost certainly will ignore any of grsecurity's anti-bruteforcing features.

They will be proposing "ASLR-NG" which includes their "fix" for the AMD Bulldozer issue -- a per-boot randomization of the 3 mmap/vdso bits that would normally be 0, which can of course be trivially determined by any process on the system. It's security theater and demonstrates a lack of understanding of any real threat models.

They also make sure they receive bug bounties from Google for each of their "findings" and spam their advisories out to several mailing lists.

-Brad

Cracking Linux with the backspace key?

Posted Dec 21, 2015 16:57 UTC (Mon) by noxxi (subscriber, #4994) [Link]

> Linux security has been exposed as a laughable joke; how can anybody take such a system seriously?

I agree that this attack is much less critical than the media reports. On the other hand the media often hyped Linux as this super secure system compared to Windows, same as it hyped OS X this way. And the reality is that neither Linux nor OS X are super secure but that there are actually lots of owned Linux systems out there as part of botnets. Often these systems are installed once and left unpatched because the owner believed the hype. This combined with vulnerable Wordpress or similar installations leads to an easy compromise.

It might actually improve the security of the internet if the public realizes that Linux is not that secure as often claimed and that it needs regular patches like most of the other systems. And sometimes it needs some overreaction like now to correct a wrong perception.

Cracking Linux with the backspace key?

Posted Dec 21, 2015 17:00 UTC (Mon) by fandingo (guest, #67019) [Link] (14 responses)

I'll agree with the general sentiment that bootloader authentication is niche, and only makes any sense given careful constraints. Nonetheless, I think this article continues to imply incorrect necessities.

> An attacker must have physical access to the system's console to be able to type the famous backspaces.

True. The attacker must have access to a keyboard that grub recognizes and has a backspace key.

> In general, once an attacker can actually put hands onto a target system, the game is already lost.

Hands on what? If we're only talking about the keyboard, then hopefully not! I expect security systems to at least be effective in their domain. (Of course, things like the Xorg lock screen bypass from 2012 and this Grub vulnerability perhaps should temper my expectations of GNU/Linux security.) There is a major difference between being able to use/view the monitor and input devices, and having full physical access to the internals. (You can access the input/output devices of your bank's ATM, but I wouldn't say that the physical security of the cash box is inherently compromised.)

But, yeah, such situations where Grub authentication is appropriate seem vanishingly small. You need a computer that is physically secure, has a user accessible keyboard (or PS2/USB port), and can be rebooted (or power cycled). Nonetheless, downplaying the issue because physical security is assumed to be weak is a mistake.

> Arguably, we have just seen an exploit of a vulnerability in our public-relations system: any attacker with a "zero-day" bug and some minimal marketing skills can cause untold damage to the image of Linux as a whole. Companies deal with such issues by firing up their own PR machines, but Linux does not really have any such thing. So we are stuck trying to patch up our reputation after the fact, hoping that at least some members of the press will eventually figure out that, in fact, you really can't hack into any Linux system by hitting the backspace key.

Meh, this is a severe vulnerability, even if it impacts few installations, and shows a serious lack of attention to detail by the developers. If the security peeps wants to jump up and down and point fingers, why shouldn't they? The "untold damage to the image of Linux as a whole" is caused by the developers who wrote and approved the patch that caused this bug, not those that discovered and reported it.

The Linux community isn't exactly known for treating anything gently. There would be no end to the mocking and jeering if Windows had a similar failing, or, really, any proprietary software. But, sure, let's pull out the kids gloves when it's a problem with one of our own.

> So we are stuck trying to patch up our reputation after the fact

Perhaps the focus should be on the patching the code, and let the quality of the code do the talking.

I hate the majority of the security industry, and I generally agree that HeartBleed started a new era where vulnerabilities are highly publicized. Nonetheless, it's important to recognize how critical these security researchers, even if they're mostly blind squirrels. There are so many unfound bugs in our software that have been there for years or decades and are probably in the repertoire of the most significant APT foes. We would be well-served by being gracious to those that find these vulnerabilities because it's complicated and time-consuming to find them, even if they over sensationalize to further their personal ends in the process. We need to recognize that most people are self-interested, and allowing them to satisfy that self-interest (i.e. drumming up business) is the only way we get our part (i.e. the bug reports) out of it.

Cracking Linux with the backspace key?

Posted Dec 21, 2015 20:02 UTC (Mon) by josh (subscriber, #17465) [Link] (12 responses)

How many people have carefully configured their systems so that they can do a default boot unattended, but any non-default boot option requires a BIOS password? If you haven't, this vulnerability buys you nothing you couldn't already do.

How many people have also configured GRUB2 passwords? I'd guess a small fraction of a percent.

Cracking Linux with the backspace key?

Posted Dec 21, 2015 22:28 UTC (Mon) by fandingo (guest, #67019) [Link] (10 responses)

How many people have carefully configured their systems so that they can do a default boot unattended, but any non-default boot option requires a BIOS password? If you haven't, this vulnerability buys you nothing you couldn't already do.

Perhaps you should reread my post because you're committing the same mistake that pretty much everyone has.

The physical security of the computer components is independent of the security of a keyboard. I could have a computer running inside a bank vault with only a keyboard and monitor coming out from a narrow hole. The firmware boot password doesn't matter: the system can only boot the desired operating system (because that's the only thing bootable inside the computer), and they can't plug in a different drive because the computer is in a bank vault. In this situation, a properly implemented Grub authentication feature would prevent a passerby from maliciously changing boot options.

That is precisely the sort of use-case this authentication feature is designed to solve. It's not designed for situations where physical security is lacking because, as everyone recognizes, it's easily bypassed.

To answer your questions, precisely 42%.

Cracking Linux with the backspace key?

Posted Dec 21, 2015 22:37 UTC (Mon) by josh (subscriber, #17465) [Link]

This vulnerability does nothing unless you 1) have GRUB2 password authentication configured, *and* 2) have a system configuration that would not otherwise allow you to run arbitrary code at bootloader-time. I'm not arguing that those two conditions never coincide. I'm arguing that both conditions are sufficiently rare that the actual impact of this vulnerability is vanishingly small (even though on the tiny fraction of a fraction of systems where those conditions both occur it's a major security hole).

Cracking Linux with the backspace key?

Posted Dec 21, 2015 23:01 UTC (Mon) by einstein (subscriber, #2052) [Link] (8 responses)

> The physical security of the computer components is independent of the security of a keyboard.

To even attempt the "exploit" first requires that the attacker have sufficient access to reboot the server. If an attacker has sufficient access to reboot your server, all bets are off, and none of the rest matters anyway. Much hype about nothing.

Cracking Linux with the backspace key?

Posted Dec 22, 2015 1:31 UTC (Tue) by fandingo (guest, #67019) [Link] (7 responses)

> sufficient access

Hah, like you need authentication or authorization to reboot a system that is local, even with strong physical security.

Types of "access" needed to reboot a computer:

* discharge static electricity on case*
* unplug power cord/battery**
* press ctrl+alt+del 8 times w/ default systemd option
* Magic sys resq cmds
* press power button
* press and hold power button
* reboot action in DE (authorized)
* ...***

* Back in elementary school, we used to do this to each other on an unpainted cylinder lock on the case. It caused a short that would reboot the system (wiping out the student's progress much to her chagrin). You can still do it on most exposed metal parts on a computer.

** This is the most obvious and likely of them all. The prototypical use-case is a computer inside a locked container with a power strip. Only the "IT guy" has the key to the box, but regular employees move the thing around to locations, have access to the extension cord connecting the whole thing together. Those employees shouldn't be able to get root because they can unplug-plug the extension cord. (To give a tangible example: A couple of years ago I worked for a media company that would setup displays at auto shows, concerts, etc. Touch screens that would do some corporate spiel. One of our customers was the Oregon Department of Health. We outfitted a large bus for an exhibition -- state fair I believe -- with 10 computer terminals. Attendees at the event could sign up for their Obamacare right there. These computers were all in a cabinet at the back of the bus that was padlocked -- only monitor, keyboard, mouse cables emerging, plus the power cord for the powerstrip. Had we been foolish enough to throw a Linux distro on there in kiosk mode, it would be trivial for a user to issue a key combo to reboot the system or unplug the extension cord from the generator, and with this bypass could edit the boot options. Double plus ungood. Again, remember that the employees on-site are barely more trustworthy than the public users; the only trusted administrator is me, some guy 1,500 miles away, who has never been to Oregon.)

** Means typical and up, so things like $(reboot), $(systemctl poweroff), $(shutdown), etc. No need to list each one.

The point that I'm trying to make is that the situations where a Grub password begins to make sense (kiosk, POS, semi-embedded, etc.) is where it's pretty easy for a user to cause the computer to reboot without any sort of software-based authorization (only exceptions on that list are "..." and rebooting within a DE). It's totally unacceptable that these "privilege escalations" ultimately can result in root execution (causing reboot, backspace * 28, editing kernel cmd line, init=/bin/sh or whatever).

The thing is that this is emblematic of the GNU/Linux ecosystem. To do something useful, you have to employ a bazillion different pieces of software all written by different groups with disparate objectives and no accountability to one another, and that software is assembled by one or more other groups to get to you. And all it takes is a tiny chink in one of those bazillions of pieces to compromise the entirety of the armor you've responsibly assembled. What piece of software could be more boring than a bootloader? Is there much more basic than a user typing a password at a basic console prompt? Yet, here we are with a boring piece of software making a simplistic mistake that nullifies *all* of the complex security systems surrounding it. Poof, Secure Boot, SELinux, kernel DAC, PaX/Grsec, disk encryption, etc., etc., etc., suddenly don't matter. The whole house of cards collapses.

Yes, a lot of people sensationalized this particular bug. It is not a common configuration. Nonetheless, I think a lot of people are trying to make it seem like it's nothing. It absolutely is: It's just chapter n+1 in the tale of how every single piece of software you use likely 1) has a vulnerability, 2) it's probably been there for a very long time, and 3) your security measures probably are totally ineffective at stopping it.

Cracking Linux with the backspace key?

Posted Dec 22, 2015 1:57 UTC (Tue) by josh (subscriber, #17465) [Link] (2 responses)

> disk encryption, etc., etc., etc., suddenly don't matter

Why would this matter for disk encryption at all? If you use disk encryption, you'd need to answer the passphrase prompt on startup, and GRUB's password prompt wouldn't matter.

In any circumstance in which you can require a password on boot, you should be using full disk encryption. GRUB's password mechanism only helps in the circumstance where you *don't* use full-disk encryption, want to boot the default option with no password, but want to require a password to boot anything but the default.

And in those circumstances, why let GRUB prompt *at all*? Just make GRUB automatically boot the default option with no prompt. If you want a non-default option, boot from USB or similar.

(Also, in terms of potentially interesting security issues: if you "secure" a system in a locked box with only the monitor and keyboard coming out, but the keyboard is USB, a sufficiently creative user could cut the keyboard USB cable and splice in a hub with a keyboard and USB key.)

Cracking Linux with the backspace key?

Posted Dec 22, 2015 2:18 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link]

In a typical kiosk mode you don't enter the disk password, since kiosks have to work autonomously without any administrator interaction. So pretty much the only options are secure boot or a static password (==no password).

Cracking Linux with the backspace key?

Posted Dec 22, 2015 2:38 UTC (Tue) by fandingo (guest, #67019) [Link]

> Why would this matter for disk encryption at all? If you use disk encryption, you'd need to answer the passphrase prompt on startup, and GRUB's password prompt wouldn't matter.

Because you can have the system execute your own commands before the employee is prompted for the password. You can do anything you want in the initramfs or /boot that is available before you execute the unlock password prompt. The attacker is now executing arbitrary code with the disk unlocked.

Cyberax is correct about why using a password prompt for encryption is impractical.

> And in those circumstances, why let GRUB prompt *at all*?

If I have an itch to scratch, and Grub says it scratches, why shouldn't I use it? Grub has advertised this feature for many, many years; why would they include it if they didn't expect users to utilize it? Due to the editable nature of Grub entries and the included shell, they really have to support a password feature.

Cracking Linux with the backspace key?

Posted Dec 22, 2015 3:34 UTC (Tue) by einstein (subscriber, #2052) [Link] (3 responses)

> Hah, like you need authentication or authorization to reboot a system that is local, even with strong physical security.

Thank you - you just made my point, namely that if an attacker has sufficient access to reboot the box, all bets are off. And unfettered physical access to said box would give an attacker the world on a silver platter, regardless of what OS is running.

Cracking Linux with the backspace key?

Posted Dec 22, 2015 3:49 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

How?

Imagine a stand-alone terminal, with physically controlled access to hardware (aka "solid metal enclosure"). You can force a reboot by unplugging it, but you can not manipulate the hardware itself.

It's not an unusual configuration.

Cracking Linux with the backspace key?

Posted Dec 22, 2015 7:40 UTC (Tue) by einstein (subscriber, #2052) [Link] (1 responses)

> How?

If an attacker has sufficient access to reboot the box, all of the concerns about the supposed exploit are moot anyway. (as you mentioned, power cycling the box is one method of rebooting) If the attacker is unable to reboot the box, then the potential grub vulnerability isn't accessible, no matter what he does with the keyboard.

Cracking Linux with the backspace key?

Posted Dec 22, 2015 7:54 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link]

Please, read my other comment.

In the real world out there a simple mechanical lock is often enough to secure the system.

Cracking Linux with the backspace key?

Posted Dec 21, 2015 23:51 UTC (Mon) by ajdlinux (subscriber, #82125) [Link]

I didn't even know that GRUB supported passwords until this bug appeared in the media, and I've been a Linux user for ~14 years. I'd honestly be surprised if the proportion of users using GRUB passwords was more than ~0.1%.

Cracking Linux with the backspace key?

Posted Dec 27, 2015 23:06 UTC (Sun) by dag- (guest, #30207) [Link]

Risk = Impact * Probability

Impact may be severe.
Probability is low (Since the scope is very limited, for most of my customer's production environments, probability is close to, if not zero)

So the risk is quite low as the article details, unless for very specific use-cases where console-access + physical access is provided to untrusted individuals.

Cracking Linux with the backspace key?

Posted Dec 21, 2015 20:48 UTC (Mon) by rknight (subscriber, #26792) [Link] (2 responses)

Why is a bug in a boot loader considered a Linux bug? Grub2 can also be used to boot many other operating systems. So is this also a bug in Windows and FreeBSD?

Cracking Linux with the backspace key?

Posted Dec 21, 2015 21:05 UTC (Mon) by khim (subscriber, #9252) [Link]

The same confusion as always. GRUB2 is indeed part of typical GNU/Linux install but not part of typical Windows or FreeBSD install. You COULD use GRUB2 with Windows and/or FreeBSD, but that's rare and unusual setup. Sadly RMS attempts to push for clear separation between Linux and GNU/Linux have failed and by now it's too late.

Cracking Linux with the backspace key?

Posted Dec 21, 2015 23:30 UTC (Mon) by branden (guest, #7029) [Link]

Next you'll be telling us to call the system GNU/Linux! ;-)

Cracking Linux with the backspace key?

Posted Dec 21, 2015 21:07 UTC (Mon) by alanjwylie (subscriber, #4794) [Link] (1 responses)

How many systems just have a grub password, rather than full disc encryption?

Cracking Linux with the backspace key?

Posted Dec 22, 2015 16:04 UTC (Tue) by jrigg (guest, #30848) [Link]

>How many systems just have a grub password, rather than full disc encryption?

All of mine have for the last 10+ years (or however long grub has been around; before that I used passwords in LILO). In my case it's merely to reduce the likelihood of random idiots causing a nuisance and not meant as a serious security measure.

Yet another step?

Posted Dec 21, 2015 23:14 UTC (Mon) by Max.Hyre (subscriber, #1054) [Link]

Once grub2 has started booting, is it possible, from the keyboard, to interrupt the process before you get to the login screen? (My system's down, waiting for a motherboard, or I'd try a few things myself.) If not, we have another step:
  • Break into the system from the login prompt. Good passwords will make this harder.
See above for access to the system proper, not just the kbd & screen, and whole-disk encryption.

It's all a big conspiracy...

Posted Dec 22, 2015 1:50 UTC (Tue) by pr1268 (guest, #24648) [Link] (1 responses)

This ZDNet article, and the Washington Post article before it, are the work of shills from Redmond. Think about it: Windows Phone is barely sputtering along on life support, and tablet PCs with a non-Microsoft OS are outselling those with Windows by a considerable margin—it's all sour grapes from here on out.

</Conspiracy theory>

I would have assumed that the Grub2 issue would have stopped making news 48 hours after it broke. But, no! The tech rags mags are beating a dead horse just to sully Linux's good name. Sigh...

It's all a big conspiracy...

Posted Dec 22, 2015 18:49 UTC (Tue) by flussence (guest, #85566) [Link]

I'm inclined to agree. The biggest insecurity here is the blogger's personal own.

GRUB2 vulnerability, not Linux, and this almost never matters

Posted Dec 22, 2015 16:31 UTC (Tue) by david.a.wheeler (subscriber, #72896) [Link]

This is a GRUB2 vulnerability, not one in Linux.

For almost everyone this doesn't matter anyway. This requires that you depend on GRUB2 passwords, and that's rarely important for security. E.g., on servers, most people depend on physical security - if you can reach the physical keyboard, you better be authorized anyway (after all, someone can just remove the drives if they have physical access).

So while it's technically a vulnerability, it's an exploitable vulnerability in only rare circumstances; most people don't depend on this functionality.

Cracking Linux with the backspace key?

Posted Dec 24, 2015 18:48 UTC (Thu) by KernelEngineer (guest, #99939) [Link]

Thanks a lot for the info.....Linux always Rocks :-)

Cracking Linux with the backspace key?

Posted Dec 24, 2015 22:15 UTC (Thu) by kpfleming (subscriber, #23250) [Link]

"Companies deal with such issues by firing up their own PR machines, but Linux does not really have any such thing."

Imagine a world that included a large, organized, and well-funded foundation whose primary purpose was to advance and support the Linux 'product' and its ecosystem If such a thing existed, it could certainly employ its resources to combat this sort of disinformation campaign, like big companies do.

(apologies for the slightly trolly nature of this comment, but Linux *does* really have such a thing already)

Cracking Linux with the backspace key?

Posted Dec 26, 2015 23:13 UTC (Sat) by nettings (subscriber, #429) [Link] (2 responses)

And that is why Linux will never be as secure as Apple machines. I've learned the lesson and am now busy ripping out the backspace keys from all my consoles. Happy holidays :)

Cracking Linux with the backspace key?

Posted Jan 21, 2016 0:21 UTC (Thu) by Pawlerson (guest, #74136) [Link] (1 responses)

You mean the ones that are always hacked first in the hacking contests? It seems you didn't learn the lesson. Otherwise you would throw your Apple toy out of the window(s). Have a nice day.

Cracking Linux with the backspace key?

Posted Jan 21, 2016 21:07 UTC (Thu) by flussence (guest, #85566) [Link]

The only response your comment deserves is "whoosh".


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