Unlocking God Mode On X86 Processors

We missed this Blackhat talk back in August, but it’s so good we’re glad to find out about it now. [Christopher Domas] details his obsession with hidden processor instructions, and how he discovered an intentional backdoor in certain x86 processors. These processors have a secondary RISC core, and an undocumented procedure to run code on that core, bypassing the normal user/kernel separation mechanisms.

The result is that these specific processors have an intentional mechanism that allows any unprivileged user to jump directly to root level access. The most fascinating part of the talk is the methodical approach [Domas] took to discover the details of this undocumented feature. Once he had an idea of what he was looking for, he automated the process of checking every possible x86 instruction, looking for the one instruction that allowed running code on that extra core. The whole talk is entertaining and instructional, check it out after the break!

There’s a ton of research poking at the instruction level of complication processors. One of our favorites, also by [Domas], is sandsifter which searches for undocumented instructions.

38 thoughts on “Unlocking God Mode On X86 Processors

      1. Not likely. It took what, 18 years to find this bug/feature. It’s a small community that pay attention to, and an even smaller community that go hunting for these security beaches. This publicity isn’t loud enough and many of the people will be content in that ‘not my hardware, not my problem’ sentiment. Disregarding that if it’s on these chips a similar beach is probably on their hardware. So it is in fact their problem.

        Has anyone checked their https certificates lately? Remember the fantastic beach of issuing protocol on those a few years ago?

  1. What is with the clickbait title? This exploit only affects ancient VIA C3 CPUs which came out nearly 20 years ago and only some boards with a BIOS which mistakenly leaves it enabled. It is a VIA specific extension so it won’t work on anything else.

    It is just a terrible implementation by VIA. They did document this but you needed to sign NDAs and be a big customer to get the documentation. They just referred to it as an “alternate instruction set” designed to be used for debugging and testing. Presumably it would have been used for something like SMM.

    If you’re still running a VIA C3 then you need to consider upgrading as they were glacially slow even when brand new.

        1. What you are assuming is that Domas exhaustively examined ALL possible processors. And even if he did, his methods might, for some unexpected reasons turn up nothing when there in fact still is a problem/hidden processor.

          What happened is that he happened to read a few patents and deduced that something like this might be possible to figure out for VIA C3 CPUs. So he got a few computers and when things looked promising he dove deeper. (and bought more of those computers with the same CPU).

          If you listen to his talk you will notice that the patents were important in finding a direction in which to search. If say AMD decides not to patent their “hidden CPU” ideas, it is quite possible that the AMD processors to this time share a similar hole, just that it is even harder to find.

    1. you have missed the point entirely – it isn’t that this particular processor had this particular backdoor, it’s 1) these are the types of tools/ things you can do to probe hardware, and 2) who knows what other backdoors other processors have! Particularly if people were silly enough to do this one!
      And yes, it has to be public preasure that stops them doing things like this…

    1. Yup, that’s the thing…. it’s like “closing” the X86 instruction translation “program” (an electronic logical mechanism block that outputs RISC code for the RISC core to execute)
      And then just running code directly onto the RISC core.

      A modern X86_64 system looks more and more like a set of virtual machines (hypervisor, SMM) made out of hardware blobs (SMM) and software blobs (Intel Management engine, AMT, etc) etched onto a piece of silicon (SoC/atom) or few(CPU+PCH or CPU+North+South bridges).

      Heck, I guess by emulating the functions of a modern X86 system on multiple STM32 and/or atmel MCUs that are as clocked as fast as the CPU that mess is simulating… there would be no noticeable drop in performance.

      Risc core on the output of an Atmel that translates and organizes instructions (Pipeline controller+Translation bus),

      MMIO by taking pointer data from the RISC core and tests the boundary…
      Kernel mode vs User mode…. Just check the permissions via another controller…

      and so on….

    1. Seriously? I can see how some of the things on here trigger that “Not a Hack” reaction, but this one? This is the kind of stuff this site is made for. Even if the end result wasn’t earth-shattering, that’s some real outside the box thinking there.

    2. He built a cluster of computers and used brute force methods to find instructions to crash them. Note, this was not the goal.. Then had another system to detect and recover failed nodes automatically. Yes its a hack!

  2. For me the takeaway lesson from this is not that such features exist, I already understood this was possible, but rather that it is possible to reverse engineer and exploit such a feature starting with very few clues just by being logical and systematic in how you go about mapping out the processor’s behavior. Once again somebody proves that obscurity is not security.

      1. No you are just arguing for the sake of it and being a bore. Before now did you honestly believe that a people could go through the sequence he did to arrive at the instruction set of the RISC core? It is certainly a first for the public domain, even if such antics are routine for the NSA et al.

        1. Pffft! Did you hold your pinky up before typing that? Using one’s brains, talents and available information happens all the time. It’s the foundation for hacking. So yes I believe others could and probably have done this before.

  3. It’s on the old VIA C3, so big deal. To actually do anything with this info one would have to know the native instruction set of the RISC core in order to run anything on it while ignoring the x86 ‘wrapper’ and translation system.

    What would be interesting is an operating system and applications written to run directly on the CPU’s real core. Would it have any performance advantage over running a conventional x86 OS on it?

    1. Did you watch the video all the way through? Or just stop when he said that?
      Man… you missed out!

      He goes about reverse engineering just enough of that unknown instruction set to actually write a privilege escalator!

      That alone would be a worthy hack! This is about a dozen hacks layered one atop the next at least!

      He does say, that to get that god bit *set* requires root…. but that some systems come out of the box with it already set! (meaning, insta root with a couple-page long .c file from an ordinary user account).

      Scary!

      But what’s interesting and impressive about this isn’t that he did this on this one old system, it’s the approach of it. No help, no docs, just a suspicion, a handful of patents carefully read yielding vague descriptions of a possible ‘secret handshake’, and some very clever hacks!

      We’re easily at the point where we cannot know for certain whether our computer systems — which we depend upon for most of our engineering (including the design of new chips!) — are in fact not already compromised. New chips are compiled now. The artwork is far too big and detailed for even a large team of humans to actually verify by inspection.

      Did you ever hear about the concept of a compromised compiler for the self-hosting language, that, when detecting it is compiling itself, reinserts the compromise so the source code stays perfectly clean, and the compromise survives another generation?

      So what happens if the chip manufacturer themselves gets compromised, and the attacker can ensure his own hidden core is a part of each new generation of chip?

      If you can’t measure it, you can’t control it. No measure-record-analyse cycle, no science. No science, no engineering also. Just, ‘wizardry’.

  4. All these “Meh, not much of a Hack” or “this is old tech”… do you trust your current CPU? your phone, watch, smart-tv? what if you had the tools to go out, and find these hidden instructions? You have to start somewhere “simple” right? Its a very interesting talk and altho its VIA and an older cpu, it got me wondering about more modern systems, with microcode updates and many cores with core inside them. I heard you guys liked dem various architectures, so Ive put all of em in your Intel i9000-1337 ;)

    1. You are correct. All you need to know is where it is looking for a trusted signed update and spoof it. Inject whatever package you want at that point and resign the code. There is also the issue with firmware updates and access levels of internal devices that can allow for sniffing and injection of code or diagnostic/qc modes ????

  5. “x86 processors” did kind of imply the sort that people actually use. Rather than a low-performance, bottom-end chip from 20 years ago. Fairly sure they were never used in servers, and it’s really really unlikely you’ll find one online or offline nowadays.

    Sure it’s interesting the way the guy hacked his way in, but the title of this dresses it up like it’s a way of getting hold of the We Know Best Module in a modern Intel or AMD CPU. Making it possible to pwn millions of machines and theoretically not get caught. Much more interesting than this.

    Not that this isn’t interesting, but be careful with the hype.

  6. Excellent insight and description in that presentation. I’m amazed at the work that went in for possibly no value to the output unless you found the backdoor. I like how it was listed as a case study but it is much more than that. If properly exploited this flaw could do damage to national security and at minimum could cause extensive damage by making identity theft easier. I have to think sometimes that these very complex holes or privilege escalations are left there by design and I won’t say more about that. We need to keep a close eye on our “Trusted sources”.

  7. This “feature” is documented on the data sheet of the CPU (actually on many data sheets of different CPUs from the same vendor) so I find it weird that he spent so much time and effort going over patent docs and doing all this fuzzing and the side channel attack just to discover something mentioned on the CPU’s data sheet (which should have been the first thing he should have read). As for the instruction set someone is using it, there must be at least one binary out there that includes code for that separate processor (which is not really a separate processor -since it shares the same register file etc-, it’s a different execution mode as the data sheet mentions, it seems as a way to directly run microcode) and it shouldn’t be too hard to find those segments of continuous LEA or BOUND instructions. I’d start with the firmware code implemented on the BIOS, that code is probably the reason he got the MSR bit pre-enabled on those PCs because someone forgot to turn it off. Maybe some windows drivers from VIA are using it as well. Also it turns out that some information regarding that instruction set were present on some presentations from VIA and patent docs as well, including hints on their formating. I’d expect he would use such information on his fuzzer. I don’t get why he did it the way he did but kudos for his work and for finding the issue with those PCs (I’d expect to see a patch for the Linux kernel to clear this MSR bit as it happens on Windows) !

  8. All that matters is those 3 letters represent my country and not another. Think of all the good that came from having a backdoor into every mainframe fort he past 40 years, countless wars stopped before making past the planning stage, financial advantages that have kept our country from collapsing and so on. There’s a lot going on in the world we don’t know about and that’s a good thing or none of us would be able to sleep soundly.

Leave a Reply to GotNoTime Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.