Editing Vulnerabilities
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 279: | Line 279: | ||
|? | |? | ||
|Jak X: Combat Racing (PAL and NTSC, PAL has more symbols) | |Jak X: Combat Racing (PAL and NTSC, PAL has more symbols) | ||
|Two exploits: String Buffer Overflow via unchecked profile name | |Two exploits: String Buffer Overflow via unchecked profile name copy during saving and Custom code injection via patch.bin file | ||
|When saving data, the profile name can be copied out-of-bounds | |When saving data, the profile name can be copied out-of-bounds. By injecting a signed file named patch.bin in the savedata folder, custom code can be executed by the game. | ||
|Maybe in Greatest Hits/Platinum release | |Maybe in Greatest Hits/Platinum release | ||
|September 26th, 2024 | |September 26th, 2024 | ||
|CelesteBlue | |CelesteBlue | ||
Line 433: | Line 433: | ||
See also [https://jakanddaxter.fandom.com/wiki/Bugs Jak and Daxter games bugs on jakanddaxter.fandom.com]. | See also [https://jakanddaxter.fandom.com/wiki/Bugs Jak and Daxter games bugs on jakanddaxter.fandom.com]. | ||
===== Profile name string overflow during saving | ===== Profile name string overflow during saving ===== | ||
A profile name is asked to the player when starting a new game, and the length is limited to 12 characters by keyboard. However, by crafting a custom savedata, it is possible to use longer profile names. | |||
The game displays up to ?32? characters of the profile name, loaded from the header of each savedata file. The header profile name is only used for display and does not create any bug when overflown except visual ones during savedata loading. The body profile name must not be too long else the game freezes during loading savedata. If it is short enough, the savedata loads fine, but being long enough it can overflow and be used for exploitation when saving data. When the body filename length is intermediate, the savedata can be loaded, the overflow occurs, but when saving data, instead of saving properly or crashing, the game enters an infinite loop like with the other classical savedata bug. | |||
* Normal profile name should be between 1 and 12 characters. | |||
* Extending profile name to between 13 and 19 characters does not create any bug. | * Extending profile name to between 13 and 19 characters does not create any bug. | ||
* With a profile name of 20 characters or more, the game will be affected. During the load of an evil savedata, there is not necessarily any strange behaviour except the graphical glitches of | * With a profile name of 20 characters or more, the game will be affected. During the load of an evil savedata, there is not necessarily any strange behaviour except the graphical glitches of profile name display, however when saving with this extended profile name, the game crashes. | ||
* Between 20 and 23 characters, the savedata can be loaded and when saving data, the game crashes with user-controlled $pc. | * Between 20 and 23 characters, the savedata can be loaded and when saving data, the game crashes with user-controlled $pc. Sadly in this case, the $pc can only be set to 256 hardcoded values of which none points to user-controlled memory, so there is no easy way to launch a shellcode. | ||
* Between 24 and ? characters, the savedata can be loaded but when saving data, the game enters an infinite loop. | * Between 24 and ? characters, the savedata can be loaded but when saving data, the game enters an infinite loop. | ||
* With ? or more characters, the savedata cannot be loaded because the game freezes. | * With ? or more characters, the savedata cannot be loaded because the game freezes. | ||
* It is not possible to load a profile name longer than (0x6400-0x50=0x63B0) characters because the body size and profile name offset are hardcoded. | * It is not possible to load a profile name longer than (0x6400-0x50=0x63B0) characters because the body size and profile name offset are hardcoded. | ||
Tests has shown that the final $pc is 0 and that $v1 contains the DWORD at offset 19 of the profile name. Other registers have not been controlled by now. | |||
It is required to craft valid header and footer in the savedata else the game loops infinitely on the save data loading screen. A Jak X (NTSC version) savedata contains a few files of name "saveX-Y-ZZZZZZZZ.bin" where X, Y, and Z are valid decimal numbers. They follow mostly the same structure as Jak 1, 2 and 3 but with a different magic (0xc0dfaced) and different checksum algorithm (CRC32). The file is made of a 0x400-byte header followed by 0x6400 bytes of body and a footer that is just a 1:1 copy of the header. To craft a valid Jak X savedata, the steps are: | |||
* generate a valid body, eventually with extended profile name | * generate a valid body, eventually with extended profile name | ||
* generate a default header with valid magic, profile name, etc. | * generate a default header with valid magic, profile name, etc. |