Bugs & Vulnerabilities
- 1 Theoretical Hardware Attacks
- 2 Unknown / unpatched
- 3 Patched
- 3.1 Decryption of any GEN3 PUP
- 3.2 Decryption of any usermode SELF from FW 1.00 to 3.70
- 3.3 .strtab/.symtab kernel table of symbols kept on very low FWs
- 3.4 .dynstr/.dynsym kernel table of symbols kept on low FWs
- 3.5 IDPS leak in sceSblAuthMgrDriveData on low retail FWs
- 3.6 Partial SAMU KeyRings bruteforce by missing HMAC length check in secure kernel
- 3.7 Crashdumps encryption using symmetrical key and same key across FW
- 4 Reference sites
Theoretical Hardware Attacks
We already know for certain someone out there has hacked the SAMU or stolen Sony's keys because of leaked decrypted kernels. PS4 has been out for 5 years or so and we are still running crappy browser based exploits. It is time to set up our console game people! These are some end all hardware solutions to hack the PS4 theorized by golden. I give a score out of 10 for each.
Power analysis against SAMU 9.9/10
There are theories that this won't work because...
- SAMU silicon spoofs hamming weight (prevents differential power analysis and EM analysis)
- It is running too fast and not feasible since cost is too high
- You can't slow down the SAMU clock since it is internally checked
- Some more issues?
If there is some sort of main CPU/SAMU PLL bypass we might be able to slow the clock down really easily, otherwise we must inject our own clock signal. I believe the SAMU clock is controlled by syscon? If the check is in syscon then we can just patch it out. Maybe write a custom Linux fork that never loads into usermode but just sits and constantly decrypts different self/sprx files. We could communicate with this Linux fork over UART. This attack only needs to work once to recover some keys.
SAMU power/clock glitch fault injection 5/10
During an AES round we might be able to do some SCA by injecting faults. See the paper from umass.edu in the section below. We would write a minimal operating system to reboot into after exploiting an older firmware. This 'operating system' will simply shutdown most of the CPU cores and pin one core. This code would communicate with the SAMU and do everything the normal SCE SAMU driver does for decryption. We can then use UART output from CPU to time our glitch attacks. The faulty data retrieved by our custom SAMU driver might be able to reveal secret key data. This attack only needs to work once to recover some keys.
SAMU backside UV/IR fault injection 3/10
Just as the title states. Very expensive to setup and do properly. If we can flip an even number of bits it the encrypted SAMU SRAM region of the chip (even since ECC parity bit), then some sort of side channel analysis might be able to be done to recover key material. Some silicon reverse engineering would be involved to find the SRAM region on die.
"Moreover, it is no longer possible to hit a single SRAM cell with the current etching technologies, since the width of the gate dielectric is now more than 10 times smaller than the shortest wavelength of visible light." To get an idea of the cost of this equipment... "A class of threats which cannot be ignored if the attackers have access to a larger budget (above the aforementioned $3000 and up to millions of dollars)" (hxxp://euler.ecs.umass.edu/research/bbkn-IEEEP-2012.pdf)
The fault injection is all infeasible unless some elite hackzor came out of the woodwork. We only need to have this work once.
We might be able to readout the bootrom with some microprobes? Sniff data lines somewhere? The SAMU SRAM memory is encrypted so we would have to probe the LM32 instruction bus or something... infeasible but possible.
The FreeBSD USB stack has been theorized, by a well know security researcher, to contain some high profile bugs. A dongle might just be possible. For example, last year someone ran a fuzzer on the Linux USB stack and found some crazy bugs: hxxps://github.com/google/syzkaller/blob/master/docs/linux/found_bugs_usb.md
Look at Blueborne and CVE-2017-0781. There are probably some bugs in the Sony/FreeBSD Bluetooth stack. Sony has a habit of ruining their own copy and paste. One of the reasons fail0verflow decided to attack the DS4 controller firmware was because it had a nice interface to the kernel which could contain bugs.
Unknown / unpatched
A possible exploit has been found in the SnagFilms app in the PSStore app.
Arbitrary code execution in memory has been demonstrated, although so far the system will throw an exception in the programs memory before the payload finishes loading.
If you craft a small enough payload and/or a payload that load's without causing an exception in program memory you can most likely get code execution working.
(BattleCars Exploit-Rocket League)
Buffer Overflow- [Current system software, Most recent version of application(SYSSW 2.57)/(Rocket League 1.03)]
First block all requests from:https://patch103-dot-psyonix-rl.appspot.com/
When you launch Rocket League it gets a stub file from: http://psyonix-rl-529970.c.cdn77.org/BC2/versions/103/config/BattleCars_Prod/client.bin
You can redirect that to load a huge file and/or a specifly crafted payload instead of the stub. If you use the proper file, it doesn't need to be that large, the example below is under 9mb.
Your file will be loaded into memory, when the file is large enough/a game is played and/or you wait enough time you can consistently cause a buffer overflow and the application will crash.
Depending on how you craft your payload, you may or may not have to do any of that get it working. There are no checks performed at all on file size, content, ect.
Staying on the start screen for long enough can also trigger it. If your payload isn't created properly it will take much longer to execute.
If you are having problems getting this working, you can use the example file, causing an almost instant buffer overflow upon launch of the application.
If your payload is crafted properly, you should be able to get it working withing 10-20 seconds of launching the application . A carefully crafted file may be able to exploit this or similar issues to gain code execution, among other things. It may also be possible to alter gameplay via similar methods.
No payload will be provided at the moment because this is very experimental.
VidNow (TCP Buffer Overflow)
A possible exploit has been found in VidNow app from the PSStore App.
PATCHED: Sony has hotfixed this exploit via content hashing the file while in transit. Some people have managed to reverse the hotfix but the method is not known - the PS4 checks the content. hash HTTP header from the HMAC header.
When you launch Vidnow for the first time it gets http://sceecatalogs.vidzone.tv/386/vidzone_386_US.db.psarc. This file is 5mb. This file loads into a 60k tcp buffer. No checks are done at all on the files size/hash/contents. Therefore, it is possible to redirect Vidnow to load a substitute file. When vidnow is redirected to load a large enough file the TCP Window buffer is overrun,somewhere between byte 34,125,000 and 35,000,000 of the substitute file. Despite the buffer overflow and crash, the substitute data is still transmitted and the application only throws the exception when another tcp packet is sent. As a result, the application crashes and the console locks up for a minute. Directly before the console resumes normal operations after the crash, an unusually large number of tcp (RST) packets are sent. While no exploit that makes use of this crash is currently available, a carefully crafted file may be able to exploit this or similar issues to gain code execution, among other things.
17:17:39.899984000 Request 17:17:40.000655000 Request 17:17:40 (System locks up) Crash 17:17:44.957274000 Response 17:17:48.500481000 Response 17:17:48.500567000 Response 17:17:50.356427000 (System no longer locked up) Console Regains Control (74 byte packet sent) 17:17:50.357555000 Contacts Crashlog Server/System Operation Resumes
Leap second 23:59:60 bug
Decryption of any GEN3 PUP
- Discovered by flatz.
- A bug in the handlers of PUP decryption allows any PS4 on FW 1.62 GEN3 or below to decrypt any GEN3 PUP (retail, testkit, devkit, beta) with a version above 1.00 (post-prototype).
- SM code doesn't reset state after SMI checks failure, so to decrypt arbitrary PUP, you need to ignore mailbox error after PupDecryptHeader cmd (1).
- Fixed around 1.70
Decryption of any usermode SELF from FW 1.00 to 3.70
- Sony reused keys from FW 1.00 to 3.70 on usermode modules. As a result, any usermode module from those FWs can be decrypted on a PS4 running FW between 1.00 and 3.70.
- Fixed in 4.00 with the introduction of new keyset.
.strtab/.symtab kernel table of symbols kept on very low FWs
- Sony used to have two tables of symbols on very low versions: .strtab/.symtab and .dynstr/.dynsym (.strtab/.symtab had all symbols, .dynstr/.dynsym had ~75% of them).
- Seen in 1.01 kernel. Patched in 1.03.
.dynstr/.dynsym kernel table of symbols kept on low FWs
- After Sony removed .strtab/.symtab, they still kept the .dynstr/.dynsym one.
- Patched in 2.50
IDPS leak in sceSblAuthMgrDriveData on low retail FWs
- Discovered by flatz.
- Dump IDPS from 2 EID blocks from kernel: sceSblAuthMgrDriveData(0, in_buf, 0x160, out_buf, 0xA4, 1). Pass 0x160 bytes at 0x90C00 from sflash0s1.crypt into `in_buf` and dump `out_buf`.
- It is possible because someone from sony forgot to encrypt output and that is how it was patched later.
- Patched in 3.00 retail. Works on any TestKit/DevKit FW.
Partial SAMU KeyRings bruteforce by missing HMAC length check in secure kernel
- Discovered by flatz.
- PS4 Crypto Coprocessor (CCP) interface in secure kernel has a bug that allows to dump (or better saying, bruteforce) key rings from SAMU.
That is how AES/HMAC keys from PFS, portability keys, VTRM keys, etc can be retrieved. A crypto flaw was in ability to issue HMAC operation with key length < 16, for example, by setting it to 1 you can bruteforce key bytes one by one by comparing HMAC result with HMAC result with known partial key.
- This trick may work on other crypto hardware as well if it does not restrict key lengths. Amazingly, Intel Secure Key Storage (SKS) of CSME subsystem also has a bug allowing to brute-force any key slot, but the issue exists at hardware level - insecure design of the keys distribution to crypto engines (AES, SHA, RC4). Intel didn't recognize the bug arguing that to access SKS the CSME privileged arbitrary code execution is required, but SKS is exactly designed to protect the ROM generated keys from CSME firmware...
- Patched since a FW between 7.55 (unpatched) and 9.00 (patched).
Crashdumps encryption using symmetrical key and same key across FW
- The keys never changed between 1.01 and 3.15 FWs. Then between 3.50 and 4.07 FWs they changed the keys many times but still used symmetrical key.
- Patched on FW 4.50 by using asymmetrical key. Tested between 1.01 and 4.07 FWs.