591 Paper Xbox
591 Paper Xbox
Introduction
The Xbox is a gaming console, which has been introduced by Microsoft Corporation in late 2001 and competed with the Sony Playstation 2 and the Nintendo GameCube. Microsoft wanted to prevent the Xbox from being used with copied games, unofcial applications and alternative operating systems, and therefore designed and implemented a security system for this purpose. This article is about the security system of the Xbox and the mistakes Microsoft made. It will not explain basic concepts like buffer exploits, and it will not explain how to construct an effective security system, but it will explain how not to do it: This article is about how easy it is to make terrible mistakes and how easily people seem to overestimate their skills. So this article is also about how to avoid the most common mistakes. For every security concept, this article will rst explain the design from Microsoft's perspective, and then describe the hackers' efforts to break the security. If the reader nds the mistakes in the design, this proves that Microsoft has weak developers. If, on the other hand, the reader doesn't nd the mistakes, this proves that constructing a security system is indeed hard.
tors, it is important to point out that, from a hardware point of view, the Xbox shares all properties of a PC: It has LPC, PCI and AGP busses, it has IDE drives, it has a Northbridge and a Southbridge, and it includes all the legacy PC features such as the PIC interrupt controller, the PIT timer and the A20 gate. nVidia sold a slightly modied Southbridge and a Northbridge with a another graphics core embedded for the PC market as the nForce chipset between 2001 and 2002.
On the one hand, this idea makes the security system easier and there are less possible points off attack. But on the other hand, 3 times more attackers have a single security system to hack: Although Open Source and Linux people, homebrew developers, game companies as well as crackers have little common interests, they could unite in this case and jointly hack the Xbox security system. Of the three consoles of its generation, Xbox, Playstation 2 and GameCube, the Xbox is the one whose security system has been compromised rst, the one that is now easiest to modify for a hobbyist, the one with the most security system workarounds, and the one with the most powerful hacks. This may be, because the Xbox security is the weakest one of the three, but also because Open Source people, homebrew people and crackers attacked the Xbox, while the Open Source people did not attack the Playstation 2, as Linux had been ofcially supported by Sony, so the total number of hackers was lower, buying them time.
cedure is signicantly cheaper than preprogramming the ash memory chips. reprogrammed, because ash memory can be written to many times. It would be possible to use ROM instead of ash memory, but ROM is more expensive than ash memory. Thus, the machine must not start from ash memory.
Microsoft's Perspective
It would be possible to make two of the attacks impossible, by using ROM chips instead of ash. There would be no way to reprogram them, and it would be possible to disable the LPC override functionality in the chipset, because it is not needed for the manufacturing process any more.
Startup Security
When turned on, x86-compatible CPUs start at the address 0xFFFFFFF0 in the address space, which is usually ash memory. For the Xbox, this is obviously no good idea, as ash memory can be replaced, by removing the chip, tting a socket and inserting a replacement chip. overridden, by adding another ash memory chip to the LPC bus. This override functionality is necessary, because during manufacturing, an empty ash memory chip gets soldered onto the board, an override LPC ROM chip gets connected to the board and the system boots from the external ROM, which then programs the internal ash memory. This pro-
Verication Algorithm
This secret ROM stored in the Southbridge must verify the Windows kernel in the external ash memory before executing it. One idea would be to checksum (hash) the ash contents using an algo-
rithm like MD5 or SHA-1, but this would mean that the hash of the kernel has to be stored in the secret ROM as well, which would make it imposible to ship updated versions of the kernel in future Xboxes without also updating the ROM contents - which would be very expensive. A digital signature algorithm like RSA would be better: It would be possible to update the kernel without changing the ROM, but an RSA implementation takes up a lot of space, and embedded ROM in the Southbridge is expensive. It would be ideal if the algorithm t in only 512 bytes, which is impossible for RSA.
run as smoothly on some Xboxes as on others. So the startup code in the secret ROM has to do a memory test, and if it fails, clock down the RAM, do another memory test, and if it fails again, clock down again, and so on, until the test succeeds or the RAM cannot be clocked down any further. The problem now is that it is impossible to do complex RAM initialization, data decryption and hashing in 512 bytes. This code would need at least 2 KB, which would be signicantly more expensive, if embedded into the Southbridge. We could put the RAM initialization code, which is the biggest part of what the startup code needs to do, into ash memory, and call it from the secret ROM, but this would kill security, as an attacker could easily see the unencrypted code in ash, modify it and have the control of the machine right at the startup. The developers at Microsoft had a brilliant idea how to solve this problem: They designed an interpreter for a virtual machine that can read and write memory, access the PCI cong space, do AND and OR calculations, jump conditionally etc. The instruction code has one byte instructions and two 32 bit operands, it can use immediate values as well as an accumulator. The interpreter for the virtual machine is stored in the secret ROM, and its code (xcodes) is stored in ash memory. This code does the memory initialization (plus extra hardware initialization, which would not be necessary). This program cannot be encrypted, as there is again no space for it in the secret ROM, but as the virtual machine is unknown to the hacker, encryption should not be that important. It also cannot be hashed, as this would make it impossible to change the xcodes for later revisions of the Xbox hardware. Therefore we have to make sure that, if the hacker knows how the virtual machine works, it is impossible to do anything malicious with the xcodes.
RAM Initialization
Decrypting ash memory contents into RAM is a challenge if we are living inside the rst few hundred bytes of code after the machine has started up: At this point, RAM might not be stable yet. The reason for this is that Microsoft bought cheap RAM chips; they just took everything Samsung could give them to lower the price, even faulty ones, i.e. chips that will be unstable when clocked at the highest frequencies specied. The Xbox is supposed to nd out the highest clock speed the RAM chips can go and run them at this frequency - this is the reason why some games don't
The xcode interpreter has to make sure that the xcodes cannot read the secret ROM, which is located at the upper 512 bytes of the address space. The simplest way to accomplish this is to mask the address when reading from memory:
and ebx, 0FFFFFFFh; clear upper 4 bits mov edi, [ebx] ; read from memory jmp next_instruction
been authentic. (If you are getting suspicious now read on!) In practice, the secret ROM in the Xbox compares the last decrypted 32 bit value with the constant of 0x7854794A. If it is incorrect, the Xbox has to panic.
Panic Code
So far, the code in the secret ROM does this: Enter protected mode, and set up segment descriptors, so that we have access to the complete at 32 bit address space. Interpret the xcodes. Decrypt and hash the second bootloader, store it in RAM If the hash is correct, jump to the decrypted second bootloader in RAM, else panic. There is another possible attack here: A hacker could deliberately make the hash fail. If the Xbox then halts and ashes its lights to indicate an error, the attacker can attach a device to dump the secret ROM after the CPU has shut down and the bus is idle. Although HyperTransport is fast, it would be a lot easier to attach a device that actively requests the data from the Southbridge than snifng it when the CPU requests it. One solution would be not to halt but to shut down the Xbox in case of a problem. The support chips have this functionality. But incorrect ash memory does not necessarily mean that there has been an attack, it could also be a malfunction, and the machine should use the LED to blink an error code. So we should leave the Xbox running, but just turn off the secret ROM, so that it cannot be read any more. But there is a problem: We have to do this inside the secret ROM. So if we disable the ROM, we cannot have the hlt instruction after that, because the CPU will fall down into ash memory where an attacker could put code. On the other hand, if we halt the CPU, we cannot turn off the secret ROM afterwards. We cannot put the disable and halt code into RAM and jump there, because RAM might not be stable, and might even have been tampered with by an attacker (e.g. by turning off the memory controller using the xcodes) so that the secret ROM does not get turned off. We cannot put the disable and halt code into ash either, as again, an attacker could simply put arbitrary code to circumvent the complete system there. The Microsoft engineers used yet another brilliant trick: They jump to the very end of the address space (which is covered by the secret ROM) and turn off the secret ROM in the very last instruction
This way, the xcodes can only ready from the lower 256 MB, which is no problem, as there are only 64 MB of RAM, and memory mapped I/O can be mapped into this region using PCI cong cycles. Turn off the Secret ROM The xcodes may also not turn off the secret ROM, or else the CPU, while executing the xcode interpreter, would fall down from the secret ROM into the underlying ash ROM, which is also mapped to the top end of the address space. The turn off functionality is important: As soon as the second bootloader takes over, the secret ROM has to be turned off, or else an attack against a game, which makes it possible to run arbitrary code, could dump the secret ROM, making additional attacks against it possible. The secret ROM can be turned off by writing a value with bit #1 set to the PCI cong space of device 0:1:0, register 0x80. So the xcode interpreter always clears this bit in case there is a write to this PCI cong space register:
cmp ebx, 80000880h ; MCPX disable? jnz short not_mcpx_disable; no and ecx, not 2 ; clear bit 1 not_mcpx_disable: mov eax, ebx mov dx, 0CF8h out dx, eax ; PCI configuration address add dl, 4 mov eax, ecx out dx, eax ; PCI configuration data jmp short next_instruction
After the last instruction, the program counter (EIP) will overow to 00000000, which, according to the CPU documentation, causes an exception, and as there is no exception handler set up, it causes a double fault, which will effectively halt the machine.
In order to nd out what was wrong, bunnie rewrote the top of ash with his own code, and later even completely erased the upper 512 bytes, but the Xbox still booted! So it was obvious to him that this region gets overridden by some internal code. As it turned out later, the code in the upper 512 bytes of the ash image was a very old version of the secret ROM code, which had been unintentionally linked to the image by the build tools. It seems like nobody had looked at the resulting image at the end, before they shipped the consoles. This mistake was very close to a fatal one, and Microsoft was lucky that they didn't link the actual version of the secret ROM. But it didn't make that much of a difference, as bunnie sniffed the busses, and eventually dumped the complete secret ROM, including the RC4 key from HyperTransport, using a custom built sniffer after all, he was working on his PhD degree about high performance computing, and he could use the excellent resources of the MIT hardware lab. When he published his ndings, other people found out quite quickly that the validity check did nothing at all: The combination of decryption and hash with a cypher that feeds back the decrypted data into the key stream is a good idea, but unfortunately, RC4 is no such cypher. It decrypts bytes independently, so if one byte is wrong, all the following bytes will still be decrypted correctly. So checking the last four bytes has no effect: There is no hash. It turned out that the cypher used in the old version of the secret ROM as found in ash memory used the RC5 cypher. In contrast to RC4, RC5 does feed the decrypted stream back into the key stream. So they seem to have replaced RC5 with RC4 without understanding that RC4 cannot be used as a hash. Bunnie's theory why they abandoned RC5 is that RC5 was still a work in progress, and that Microsoft wasn't supposed to have it, so they went for the closest relative - RC4.
Modchips
Now that the encryption key was known and there was effectively no hash over the second bootloader, it was possible to patch this code: People added code to the second bootloader to patch the kernel after decryption (and decompression) to accept executables even if on the wrong media (DVD-R instead of original) or if the RSA signature of the executables was broken (i.e. unsigned homebrew software). Modchips appeared: Some of them had a complete replacement ash memory chip on them, others only patches a few bytes and passed most reads down to the original ash chip. All these modchips had to be
soldered in parallel to the original ash chip, using 31 wires. Now other people found out that, if the ash chip is completely missing, the Xbox wants to read from a (non-existant) ROM chip connected to the (serial) LPC bus. This is of course because of the manufacturing process: As it has been explained before, the ash chip gets programmed in-system, the rst time they are turned on, using an external LPC ROM chip. Modchip makers soon developed chips that only needed 9 wires and connected to the LPC bus. It was enough to ground the data line D0 to make the Xbox think that ash memory is empty. Lots of these cheapermods appeared, as they only consisted of a single serial ash memory chip. They could be installed within minutes, especially after some companies started shipping chips that used pogo pins, so that no soldering was required. Some groups wrote applications like boot menus that made it possible to copy games to hard disk and run them from there. Patched Xbox kernels appeared that supported bigger hard disks. Making the Xbox run copies from DVD-R or hard disk as well as homebrew applications written with the ofcial Xbox SDK was now easy.
Backdoors
The Xbox Linux Project was working on two ways to start Linux: Either run the Linux kernel from a CD/DVD as if it was a game, or run it directly from ash memory, or from HD/DVD using a Linux bootloader in ash memory, so that the Xbox behaved like a PC. For the latter, Xbox Linux was working on a replacement rmware. It would have been no problem to write a replacement rmware that took over execution instead of the second bootloader, as it was possible to completely replace this second bootloader, as well as encrypt it, using the well-known key from the secret ROM. But the rmware developers felt very uncomfortable with the idea of using this secret key in their GPL code. Other hackers felt the same, and thus were looking for bugs and backdoors in the secret ROM code, in order to nd a way to be able to implement a replacement rmware without having to deal with encryption. The Visor Backdoor A hacker named visor, who never revealed his real name, wondered whether the rollover to 00000000 in case of an incorrect 2bl hash really caused a double fault and halted the CPU. He used the xcodes to write the assembly instruction for jmp 0xFFFF0000 to the memory location 00000000 in RAM and changed the last four bytes in 2bl, in order to make the secret ROM run the panic code. The
Xbox happily continued executing code at 00000000 and took the jump into ash. When appending these instructions to the existing xcodes, he could make sure that RAM had been properly initialized and was thus stable. So there was no need to encrypt the Xbox Linux bootloader rmware with the secret key any more. It was enough to add the memory write instruction to the end of the xcodes and make sure that 2bl decryption fails - which will automatically happen, if the rmware replacement does not contain the 2bl code. Now why is there no double fault? Hackers from the Xbox Linux team checked with AMD employees and they explained that AMD CPUs do throw an exception in case of EIP overows, but Intel CPUs don't. The reason that Intel CPUs don't is because of... 1970s stuff. Execution on x86 CPUs starts at the top of the address space (minus 16 bytes), but some computer makers wanted to have their ROM at the bottom of the address space, i.e. at 0, so Intel implemented the instruction with the encoding 0xFFFF, which is what you get when reading from addresses not connected to any chip, as a NoOperation (nop) and made the CPU throw no exception in case of the address space wraparound. This way, the CPU would nop its way up to the top, and nally execute the code at 0. AMD did not implement this behavior, as it had not been necessary any more by the time AMD entered the x86 market with it own designs, and because they felt that this behavior was a security risk and xing it would not mean a signicant incompatibility. But why did Microsoft do it wrong? This can be explained with the history of the Xbox: AMD offered to design and manufacture both the CPU and the motherboard (including the chipset), and nVidia was contracted to contribute the graphics hardware. The rst developer systems, even outside of Microsoft, were Athlon-based, but then Intel came in and offered their chips for less money, as well as the complementary redesign of the existing AMD chipset to work with their CPU. Consequently, nVidia licensed the AMD chipset so that the AMD name vanished. This also means, that nVidia nForce chipset is essentially AMD technology, closely related to the AMD-760 chipset. So when Microsoft switched from AMD to Intel, they apparently forgot to test their security code again with the new hardware, or to read the Intel datasheets. The MIST Hack Soon after the visor hack, another vulnerability was found in the secret ROM code, attacking the
code that checks whether an xcode wants to disable the secret ROM. Let us look at this code again:
cmp ebx, 80000880h ; MCPX disable? jnz short not_mcpx_disable; no and ecx, not 2 ; clear bit 1 not_mcpx_disable: mov eax, ebx mov dx, 0CF8h out dx, eax ; PCI configuration address add dl, 4 mov eax, ecx out dx, eax ; PCI configuration data jmp short next_instruction
Another PCI Cong Space Attack There is a second sequence of xcode instructions that can disable the secret ROM just as well, which are not caught by the interpreter: The interpreter supports writing bytes to I/O ports, so it is possible to put together the code to disable the secret ROM using 8 bit I/O writes:
OUTB(0xcf8), OUTB(0xcf9), OUTB(0xcfa), OUTB(0xcfb), OUTB(0xcfc), 0x80 0x08 0x00 0x80 0x02
The PCI cong address is stored in the EBX register in the beginning. This address has to be sent to I/O port 0x0CF8, and the 32 bit data has to be sent to I/O port 0x0CFC. The address is encoded like this:
0-7 8-10 11-15 16-23 24-30 31 reg func device bus reserved always 1
This hack has been unreleased until now. It has been found not long after the MIST hack, but kept secret, in case Microsoft xed the MIST bug. In the meantime, they have implemented a x that makes all hacks impossible that are based on turning off the secret ROM. This will be described in detail later. More Ideas There have been more ideas, but few of them have been pursued, as long as other existing backdoor existed. One possible idea is to base a hack on caching...
The attack is pretty obvoius: there are seven reserved bits in the address, and the code tests for a single exact value. What happens if we write to an alias of the same address, by using an address with only some of the bits 24 to 30 changed? While the instruction
POKEPCI(80000880h, 2)
will not be caught - and works just as well, because the PCI bus controller just ignores the unused bits. This instruction disables the secret ROM, that is, the interpreter disables itself when sending the value to port 0x0CFC, and the CPU falls down to ash memory. We can put a landing zone into ash, by lling all of the top 512 bytes with nop instructions, and putting a jump to the beginning of ash into the last instruction, so that we do not have to care where exactly the CPU lands after falling down, and we are independent of possibly hard to reproduce caching effects. It is hard to nd a good reason for this bug other than carelessness. It might be attributed to not reading the documentation closely enough, as well as not looking at it from the perspective of a hacker well enough. After all, this code had been written with a specic attack in mind - but the code made hacking easier, by giving hackers a hint how to attack.
Microsoft's Perspective
Microsoft had now understood that RC4 cannot be used as a hash, so they implemented an additional hash algorithm, which was to be executed after decryption. As there were only few bytes left, the hash algorithm had to be tiny - so the Tiny Encryption Algorithm (TEA) was used. Every encryption algorithm can be changed to be used as a hash, and TEA seemed to be a good choice, as it is really small. While they were at it, they also changed the RC4 key in the secret ROM, so that hackers would not be able to decrypt 2bl and the kernel without dumping the new secret ROM.
Keeping this in mind, the attack on the Xbox is pretty straightforward: If we connect the CPU's A20# pin to GND, the Xbox will not start from FFFFFFF0, but from FFEFFFF0 - this is not covered by the secret ROM, but is ordinary ash memory, because ash is mirrored over the upper 16 MB. So by only connecting a single pin, the secret ROM is completely bypassed. What is cool about this, is that the secret ROM is still turned on. So we could easily dump the secret ROM trough one of the low speed busses (we used the I2C bus), by placing a small dump application into ash memory.
Today
In later revisions of the Xbox, Microsoft removed some pins of the LPC bus, making modchip design harder, but they could not remove the LPC bus altogether, because they needed it during the manufacturing process. In the latest revision of the Xbox hardware (v1.6), they nally switched from ash memory to real ROM - and even integrated the ROM with the video encoder. The LPC bus is not needed for manufacturing any more, as the ROM chips are already preprogrammed. So now it is impossible to replace or to overwrite the kernel image, and because of the missing LPC bus, it also seems impossible to attach a ROM override. But modchips are still possible. The obvious LPC pins are gone now, but the bus is still there. If you nd the LPC pins on the board, you can attach a ROM override just as before, the modchips are only a bit harder to install. This is because the Southbridge still has the LPC override functionality, since they did not make a new revision of it - as so often, obviously for monetary reasons.
Game Exploits
What data do games load? Graphics data, audio data, video data... - but we cannot alter them, because it is not easily possible to create authentic
Xbox DVDs, and the Xbox won't boot originals from DVD-R etc. But most games can load savegames, and these can easily be changed: The Xbox memory units are more or less standard USB storage devices (USB sticks), so it is possible to use most USB sticks with the Xbox, and just store hacked savegames on them. Plenty of Xbox games had buffer vulnerabilities in their savegame handlers. It was often as easy as extending the length of strings like the name of the player, and the game would overwrite its stack with our data and eventually jump to the code we embedded in the savegame. The procedure for the user was then to simply copy a hacked savegame from a USB stick onto the Xbox hard disk, run the game and load the savegame. But after a buffer exploit, we would normally only be in user mode - not on the Xbox, as all Xbox games run in kernel mode. The reason for this is probably a slight speed advantage, or, less likely, a simpler environment for the game, but Microsoft tried to make the environment as similar to the Windows/DirectX environment as possible, so user mode would have actually made the environment simpler for many Windows/DirectX developers. Now that we have full control of the machine, we can overwrite the ash memory chip. It is write protected by default, but disabling the write protection is as easy as soldering a single bridge on the motherboard. After all, this bridge has to be closed temporarily during manufacturing when programming ash memory for the rst time. Using this hack, it is possible, only with a USB stick, one of several games (007 Agent Under Fire, MechAssault, Splinter Cell, ...) and a soldering iron, to permanently modify the Xbox, just as if a modchip was installed. Because early Xboxes had a 1 MB ash chip, although only 256 KB had been used, it was even possible to install several ROM images in ash and attach a switch. But the Xbox Linux Project did not blindly release this hack. The rst savegame proof of concept exploit had been nished in January 2003. After that, a lot of energy was invested in nding out a way to free the Xbox for homebrew development and Linux, but not allowing game copies. Microsoft was contacted, but without any success. They just ignored the problem. Finally in July, the hack was released, with heavy obfuscation, and lockout code for non-Linux use. It was obvious that this would only slow down the hacking of the hack, so eventually, people would be able to use this vulnerability for copied games, but since Microsoft showed no interest in nding a solution, there was no other option than full disclo-
sure. The suggestion of the Xbox Linux Project would have been to work together with Microsoft to silently close the security holes and, in return, work on a method to let homebrew and Linux run on the Xbox.
Dashboard Exploits
The problem with the savegame hack was that, if you didn't want to overwrite the ash memory chip, you had to insert the game and load the savegame every time you wanted to run unsigned code. But having full control of the machine using the savegame exploit also meant we could access the hard disk without opening the Xbox. This way, it became interesting to closely examine the hard disk contents for vulnerabilities. The Dashboard is the main program on hard disk, executed every time the Xbox is started without a game in the DVD drive. The dashboard may even be the very reason the Xbox ships with a hard disk: While the settings menu and savegame management on the Nintendo GameCube t well into 2 MB of ROM, the Xbox Dashboard, which is roughly comparable in its functionality, occupies more than 100 MB. So the original idea why to include a hard disk might have been initiated by the inability to compress the Dashboard into typical ROM sizes - and they might have decided to make the best out of it, and nd additional uses for the hard disk. The dashboard loads its data les, like audio and graphics, from hard disk. With the savegame exploit, we can now alter the hard disk contents, even without opening the Xbox. Of course the dashboard executable is signed and can therefore not be altered, and all data les are hashed, with the hashes stored inside the dashboard executable. Well, all les, except for two: the font les. Consequently, there was an integer vulnerability in the font handling routines, so that we could run our own code by replacing the font les. Combined with the savegame exploit, it was as easy as transferring the savegame and loading it, which would run a script that modies the fonts. Now every time the Xbox is turned on, the Dashboard crashes because of the faulty fonts and runs our code embedded in these les. Our code reloads the Dashboard with the original fonts, hacks it, and runs it. Hacking the Dashboard meant two things: Modifying one menu entry to read XBOX LINUX instead of XBOX LIVE and running the Linux bootloader instead of the Xbox Live setup executable, and modifying the kernel to accept both applications signed with Microsoft's RSA key as well as those signed with our RSA key, from hard disk and from CD/DVD. We called this MechIn-
staller, as it was based on the MechAssault savegame exploit. Only accepting code either signed by the original key or by our key, keeping our key secret, and using heavy obfuscation again, meant that nobody could easily abuse this solution for copied games. This hack shows several things: Hackers have phantasy, the combination of aws can lead to fully compromising the security system, powerful privileged code should be bug-free and security code should really catch all cases. Oh, and there is another vulnerability, and integer vulnerability in the audio player code. The attack was developed independently of the font attack, but was inferior because it would have required the user to enter the audio player every time to run Linux.
Microsoft's Fixes
The history of Microsoft's reactions to the font vulnerability is the perfect lesson of how to do it wrong. 1. After MechInstaller had been released, Microsoft xed the buffer vulnerability in the Dashboard and distributed this new version over the Xbox Live network and shipped it with new Xboxes. 2. For the hackers, this was no major problem: It was possible to downgrade the Dashboard of a new Xbox to the vulnerable version. Just run Linux using a savegame exploit, and dd the old image. Some people felt downgrading on new Xboxes was not piracy, because after all, Microsoft upgraded Xbox Live users' hard disks to the new version without asking. 3. As the next step, Microsoft blacklisted the old Dashboard in the new kernel. It was impossible to just dd an old Dashboard image onto newer Xboxes. 4. Still no major problem for hackers: The second executable on the hard disk, xonlinedash, which is used for Xbox Live conguration, had the same bug, so it was possible to copy the old xonlinedash and to rename it to xboxdash to make it crash because of the faulty fonts. 5. Microsoft consequently blacklisted the vulnerable version of xonlinedash. 6. Again, no major problem for hackers: All Xbox Live games come with the dashupdate application, which adds Xbox Live functionality to the Dashboard for the rst Xboxes which came without it. This update application has the same font bug, and it can be run from hard disk. So it is possible to copy the le from any Xbox Live game DVD, rename it to xboxdash and let it crash.
7. Microsoft could not blacklist this one. Xbox Live enabled games run the update application every time they start, making sure the Xbox has the Xbox Live functionality. Blacklisting dashupdate would break these games. We won.
Design
#1: Security vs. Money
Be very careful with tradeoffs between security and money. There are rarely sensible compromises. Keep in mind that the very reason for the security system is to make more money, or to prevent money losses. Security systems cannot be a little better or a little worse. Either they are effective - or they are not. By saving money on the security system, you may easily make it not effective at all, not only wasting the money spent on the security system, but also making losses because it is not effective. Microsoft made many compromises. In-system programming of ash memory is cheaper than preprogramming, but an attacker can also override the rmware with an LPC ROM. Buying all of Samsung's RAM chips is cheaper than only buying those within the specs, but it made RAM initialization more complex, using up space that could otherwise be used for better security code. They chose to put the secret ROM into the Southbridge instead of the CPU, because the Southbridge was a custom component anyway and having a custom CPU would have been a lot more expensive, but keys travel over a visible bus if the secret ROM is outside the CPU. They saved money choosing not to update the Southbridge a second time, which would have xed the TEA hash and removed the visor backdoor. This would have made modchips virtually impossible.
have excellent human resources. Not only in number, but also in qualications. Microsoft put the secret ROM into the Southbridge instead of the CPU, which meant that the secret key would travel over a visible bus. This is the very fast HyperTransport bus, which, at that time, could not be sniffed using logic analyzers any mortal could afford. But with help of the resources of the MIT and using all of his expertise, bunnie could build his own hardware that could sniff the bus.
copies Although there were some overlaps between Linux and homebrew people, as well as between homebrew people and people interested in copies, these were essentially three very different groups. Because they were all locked out by the same protection, they worked together, either explicitly, or implicitly, by using the results of each other. No Linux hackers ever attacked the Playstation. When you are fair, people don't ght you.
#8: Fixes
When your security system has been broken, don't release quick xes, for two reasons: Your xes may be awed and may not actually correct the problem, and even worse holes may be found not much later, which you must x again - and ship yet another version. Instead, every time a security vulnerability is found, audit your complete security system and search for similar bugs, as well as other bugs in the same part of the system, based on the knowledge you gained from the successful hack. Microsoft failed to correct the hash problem in the second version of the secret ROM, and didn't x the visor vulnerability, which was found just weeks later. After trashing thousands of already manufactured v1.0 Southbridge chips, which was very expensive, they decided not to update the Southbridge a second time. Another example is the dashboard odyssey: Instead of blacklisting the vulnerable executables at a time, they released three updates, none of which was effective.
Implementation
#9: Data Sheets
Know everything about the components you use. Do read data sheets. Be very careful with components that have legacy functionality. Microsoft did not notice the A20# legacy functionality as a security risk. It seems that they did not completely analyze the functionality of the Pentium III Celeron, or else they should have noticed. They also apparently did not read the Pentium programmers' manual, or else they would have noticed that Intel CPUs do not panic on a FFFFFFFF/00000000 wraparound.
#10: Literature
Read (at least!) standard literature. If you are dealing with cryptography, this means you have to read at last Schneier's Applied Cryptography. Microsoft's engineers did not know that TEA must not be used as a hash, and that RC4 does not feed the decrypted stream back into the key stream.
Policies
#15: Source
Keep your source safe. Find engineers you can trust. The complete Xbox source code has leaked, including the kernel and libraries source. Groups interested in copies could easily modify it to support running games from hard disk, support for hard disks bigger than 137 GB, custom boot logos etc. This had been previously done by patching the binary.
#11: Pros
Get experienced professionals to work on your security system, both on the design and the implementation. If it's a money issue, see #1. Looking at mistakes #9 and #10, it seems very probable that at least some of Microsoft's engineers had no prior experience with cryptography or the design of a security system. We also know that people on an internship were working on Xbox security.
#12: Completeness
Check whether your security code catches all cases. If it does not, you did not only waste time implementing all of it, but you may also give hints to hackers: If there are many checks at one point of the code, it looks a lot like code that is relevant for security and an attacker can check whether all cases are caught. Microsoft made this mistake twice: The xcode interpreter tests for the secret ROM turnoff code, and doesn't catch all cases. And the Dashboard hashes all les it is going to read, except for two. This gave us the ideas where to attack.
#17: Talk
Know your enemy - and talk to them. They are not terrorists that you are not supposed to negotiate with. Their intent is not to harm you but to reach their goals. Working on their goals on their own might harm you indirectly, because the hackers may not care about the same things as you do. Seek the contact to hackers, know what they are doing and have them inform you about a vulnerability before publishing it. Make them know your position and why they should respect it, but also respect their position. Offer them to loosen the security system for what they want in exchange for the nondisclosure of their ndings. Microsoft refused to talk about the savegame and font vulnerabilities. If we had been bad hackers, we could have released both of them as-is, immediately making it possible to run copies on Xboxes without the use of a modchip. Instead, we sought contact to Microsoft: We would have preferred to see a backdoor for Linux in the Xbox security system, instead of a solution based on our ndings that would allow running copies. But as they refused to talk, we were forced to release the exploits, and they were lucky we heavily obfuscated our solutions so in order to slow down people interested in using it for copies.
#13: Leftovers
Look at the nal product from the perspective of a hacker. Hexdump and disassemble your nal builds. There could be leftovers! The Xbox ash memory image contained an old version of the secret ROM, giving us not only hints about the contents of the actual secret ROM, but also an insight into what Microsoft planned and why some mistakes have been made.
Conclusion
The security system of the Xbox has been a complete failure.