PS3 News PS3 Forums
Sorry, you must have Javascript enabled to view the PS3News.com Forums. Please visit www.PS3News.com, or enable Javascript.
360 Hypervisor Vulnerability Found!!!
  #1 (permalink)  
Old 02-27-2007
CJPC's Avatar
CJPC Online
Right Hand Man
 
360 Hypervisor Vulnerability Found!!!

Well, seems that video from that german conference was real, alas, its only on specific firmware versions (namely 4532 and 4548) , anything greater blew an efuse (so you cant downgrade), and patched this hole.

(You could disable the efuse power supply, upgrade, downgrade etc, but I'd stick with whatever firmware you have for now, its safer, if its equal or lower to those above!)

Here is an exact quote of the vulnerability and method, more to come soon!

Quote:
Security Advisory

Xbox 360 Hypervisor Privilege Escalation Vulnerability

Release Date:
February 28, 2007

Author:
Anonymous Hacker <anohacker (at) gmail (dot) com [email concealed]>

Timeline:
Oct 31, 2006 - release of 4532 kernel, which is the first version
containing the bug
Nov 16, 2006 - proof of concept completed; unsigned code running in
hypervisor context
Nov 30, 2006 - release of 4548 kernel, bug still not fixed
Dec 15, 2006 - first attempt to contact vendor to report bug
Dec 30, 2006 - public demonstration
Jan 03, 2007 - vendor contact established, full details disclosed
Jan 09, 2007 - vendor releases patch
Feb 28, 2007 - full public release
Patch Development Time (In Days): 6

Severity:
Critical (Unsigned Code Execution in Hypervisor Mode)

Vendor:
Microsoft

Systems Affected:
All Xbox 360 systems with a kernel version of 4532 (released Oct 31,
2006) and 4548 (released Nov 30, 2006). Versions prior to 4532 are not
affected. Bug was fixed in version 4552 (released Jan 09, 2007 - not a
Patch Tuesday).

Overview:
We have discovered a vulnerability in the Xbox 360 hypervisor that allows
privilege escalation into hypervisor mode. Together with a method to
inject data into non-privileged memory areas, this vulnerability allows
an attacker with physical access to an Xbox 360 to run arbitrary code
such as alternative operating systems with full privileges and full
hardware access.

Technical details:
The Xbox 360 security system is designed around a hypervisor concept. All
games and other applications, which must be cryptographically signed with
Microsoft's private key, run in non-privileged mode, while only a small
hypervisor runs in privileged ("hypervisor") mode. The hypervisor
controls access to memory and provides encryption and decryption
services.

The policy implemented in the hypervisor forces all executable code to be
read-only and encrypted. Therefore, unprivileged code cannot change
executable code. A physical memory attack could modify code; however,
code memory is encrypted with a unique per-session key, making meaningful
modification of code memory in a broadly distributable fashion difficult.
In addition, the stack and heap are always marked as non-executable, and
therefore data loaded there can never be jumped to by unpriviledged code.

Unprivileged code interacts with the hypervisor via the "sc" ("syscall")
instruction, which causes the machine to enter hypervisor mode. The
vulnerability is a result of incomplete checking of the parameters passed
to the syscall dispatcher, as illustrated below.

Preconditions (registers set by unpriviledged code):

%r0 syscall no.
%r3-%r12 syscall arguments

Priviledged code:

13D8: cmplwi %r0, 0x61
13DC: bge illegal_syscall
...
13F0: rldicr %r1, %r0, 2, 61
13F4: lwz %r4, syscall_table(%r1)
13F8: mtlr %r4
...
1414: blrl

The problem is that the "cmplwi" instruction compares only the lower 32
bits of the given syscall number; the upper 32 bits are ignored. The
"rldicr" instruction, however, operates on the complete 64 bit register
value.

The syscall handler address is fetched from the syscall handler offset
table at 0x00000000.00001F68+%r0*4. Setting the upper 32 bits of %r0 to
something other than 0 will change the upper 30 bits of the address used
for the syscall handler offset table lookup. We will now explain how the
Xbox 360 security architecture interprets and aliases these upper bits.

When processing the syscall, the processor is running in "hypervisor real
mode", with the MMU switched off. However, when accessing memory
locations with the MSB cleared, an additional offset, the Hypervisor Real
Mode Offset (HRMO), will be applied to all memory addresses.

Due to the Xbox 360 security architecture, main memory is aliased to
different addresses with different properties, in order to conditionally
enable the security features (encryption and hashing). The hypervisor
sets the value of the HRMO special register so that the hypervisor code,
including the syscall jump table, resides in memory which is hashed as
well as encrypted, even when using zero-based addresses.

When accessing memory locations with the most significant address bit
set, the HRMOR setting is not applied. Due to the bug in the "cmplwi"
instruction, setting the corresponding bits in %r0 on syscall entry
allows setting the MSB, thereby overriding the HRMOR setting and tricking
the address lookup of the syscall handler to fetch from memory without
any security features.

With the syscall handler offset table aliased to unencrypted memory, the
syscall handler table can now be modified to direct the hypervisor to
jump to any location in code space that is designated for the hypervisor.
In the proof of concept implementation, a jump to existing hypervisor
code is used with a pre-loaded register value as a trampoline to force
the ultimate execution path to an arbitrary, unencrypted and executable
location in memory.

Proof of Concept Details:
As it is not possible to directly overwrite even non-priviledged code,
existing code needs to be tricked into calling the hypervisor syscall
with the desired register set. This can be done by setting up a stack
frame and forcing a context switch to this stack frame. The bug can be
exploited using the following series of physical memory writes:

Setup context switch to stack @80130AF0:

00130390: 00000000 00000000 00000000 FDFFD7FF MSR mask
00130360: 00000000 80130AF0 00000000 00000000 New stack pointer

Setup stack:

00130BD0: 00000000 80070190 00000000 00000000 NIP to context restore
00130C90: 00000000 00000000 80070228 80070228 NIP, LR after context
restore point to syscall
instruction in kernel
00130CA0: 00000000 00009030 00000000 00000000 MSR

00130B40: 20000000 00000046 00000000 80130af0 r0 = syscall nr
r1 = stack
00130B60: 80000000 address1 r4 = address to jump to

00002080: 00000350 points to mtctr %r4,
bctr in hypervisor code

Code to be executed should be placed at "address1", which can be an
arbitrary unused memory address.

Example code to output '!' to the on board serial port:

1:
li %r3, '!'
bl putc
b 1b

putc:
lis %r4, 0x8000
ori %r4, %r4, 0x200
rldicr %r4, %r4, 32, 31
oris %r4, %r4, 0xea00
slwi %r3, %r3, 24
stw %r3, 0x1014(%r4)
1:
lwz %r3, 0x1018(%r4)
rlwinm. %r3, %r3, 0, 6, 6
beq 1b
blr

Vendor Status:
Vendor was notified anonymously, and after cordial discussions a patch
was promptly released.

Recommendation:
Remove R6T3.


Reply With Quote
  #2 (permalink)  
Old 02-28-2007
hacked2123's Avatar
hacked2123 Offline
The Thinker
 
Absolutely amazing. I saw the demonstration and thought little of it more than, "It's coming".
Would I be wrong to say a week all systems purchased from November 7th, 2006 - January 10th, 2007 that weren't updated have this kernel and exploit availability?

Reply With Quote
  #3 (permalink)  
Old 02-28-2007
PS3 News's Avatar
PS3 News Online
Boss
 
At least the three people above you I'd guess...

Reply With Quote
  #4 (permalink)  
Old 02-28-2007
studtrooper's Avatar
studtrooper Offline
Caffeinated
 
Damn BugTraq! They didn't have to inform MS of that... Oh well, sources point to this exploit as getting a ball rolling for the good of the scene. God speed!

Reply With Quote
  #5 (permalink)  
Old 02-28-2007
TheRF's Avatar
TheRF Offline
Member
 
I didn't even know a hypervisor exists in an XBOX 360! So the competition starts, with PS3 and XBOX 360, right? As to who gets unsigned code running on it first...

Reply With Quote
  #6 (permalink)  
Old 02-28-2007
hacked2123's Avatar
hacked2123 Offline
The Thinker
 
Quote:
Originally Posted by dimmujed View Post
this hack is pointless, it's been fixed. so who cares?
That's like saying "My house is safe, but there is this one guy he can get in here any time he wants; heck if he wanted to he could watch me as I type my alarm password" - - > then saying "Doesn't matter to everyone else though"

Nothing like seeing things from the inside, even if there are only a few occurence. One method that works every time, without limititation; the fall of security.

TheRF unsigned code has already been run on the X360 - the demonstration it talked about was a king kong game booting and then after 60 seconds of shoving the system the command - - it runs a screen saver with Tux (the linux penguin).

Last edited by hacked2123; 02-28-2007 at 03:26 AM.
Reply With Quote
  #7 (permalink)  
Old 02-28-2007
profycy2k's Avatar
profycy2k Offline
Newbie
 
i dont get it, how do u know whether you can run it or not, i bought mine in feb 06' its fully updated, will i be able to run it?

Reply With Quote
  #8 (permalink)  
Old 02-28-2007
shimman's Avatar
shimman Offline
Newbie
 
does ms pay for the job the hacker did?
last time i heard, ms is treating those "ethical" hackers like a trash.

not sure why that hacker reported to ms; this isn't like security problem on pc where important information could be compromised.

anyway, this is bit a mixed news because code can be run, but the hole can alos be plugged easily

Reply With Quote
  #9 (permalink)  
Old 02-28-2007
Flowcaine's Avatar
Flowcaine Offline
Newbie
 
Yeah this is pretty much useless for anyone that has fuly updated their 360. If you are at kernel 4552 it also blows and efuse preventing us from downgrading.

Reply With Quote
  #10 (permalink)  
Old 02-28-2007
MIPs's Avatar
MIPs Offline
PS3 Dev
 
Nice post! Very informative thread. I love it when exploits are explained in detail. Also, another thing that got me excited is that if you skim through IBM's BE Handbook for programming (800 pages -_-) the Cell, in chapter 11 you can see that the hyper-visor essentially works the same way. Hopefully an exploit of the same fashion can be exploited on the ps3.

I haven't been keeping up with the 360 scene though so I have a question. How exactly is code being ran and manipulated on the box? Is it a hardware hack?

Reply With Quote
Reply

Thread Tools

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

vBulletin Skin developed by: vBStyles.com
Copyright © 2009 PlayStation 3 News.
Register to Remove Ads!