Editing Vulnerabilities

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 71: Line 71:


You have to copy PS Vita/PS4/PS5 savedata files to the console.
You have to copy PS Vita/PS4/PS5 savedata files to the console.
The PSP Emulator for PS4 (and for PS5, and probably the PS1 and PS2 Emulators too) uses Lua 5.3 to read Lua scripts. However, these scripts are usually not in savedata but in game data so there is not such an easy entrypoint as the Artemis games one.


==== Vulnerable games ====
==== Vulnerable games ====
See [[Artemis Engine]] for a list of candidate games.
See [[Artemis Engine]] for a list of candidate games.


Confirmed exploitable games (Lua 5.1 usually, to confirm):
Confirmed exploitable games:
* Raspberry Cube (CUSA16074)
* Raspberry Cube (CUSA16074)
* Aibeya (CUSA17068)
* Aibeya (CUSA17068)
Line 93: Line 91:
* [https://gist.github.com/flatz/cbb84539aeee1ade1983ee2eea499dbc ROP chain manager in Lua by flatz (2024-11-02)]
* [https://gist.github.com/flatz/cbb84539aeee1ade1983ee2eea499dbc ROP chain manager in Lua by flatz (2024-11-02)]
* [https://github.com/Gezine/ArtemisLuaLoader Lua script execution PoC for Raspberry Cube (PS4 CUSA16074 and Windows) by Gezine (2024-10-06)]
* [https://github.com/Gezine/ArtemisLuaLoader Lua script execution PoC for Raspberry Cube (PS4 CUSA16074 and Windows) by Gezine (2024-10-06)]
==== Related Ressources ====
* [https://web.archive.org/web/20230308193701/https://lua-users.org/lists/lua-l/2009-03/msg00039.html Why Lua bytecode verifier was deprecated (2009-03-04)]
* [https://en.wikipedia.org/wiki/Normal_number_%28computing%29 Normal number computing on wikipedia]
* [https://en.wikipedia.org/wiki/Double-precision_floating-point_format Double-precision floating-point format on wikipedia]
* [https://en.wikipedia.org/wiki/Offset_binary Biased representation on wikipedia]
* [https://www.gnu.org/software/libc/manual/html_node/Floating_002dPoint-Conversions.html GNU Libc manual that explains the output of the %a format string]
* [https://www.lua.org/pil/2.3.html Programming in Lua: Numbers]
* [https://www.lua.org/pil/6.1.html Programming in Lua: Closures]
* [https://memorycorruption.net/posts/rce-lua-factorio Bytecode Breakdown: Unraveling Factorio's Lua Security Flaws by Memory Corruption (2024-06-29)]
* [https://conference.hitb.org/hitbsecconf2019ams/materials/D1T1%20-%20SeasCoASA%20-%20Exploiting%20a%20Small%20Leak%20in%20a%20Great%20Ship%20-%20Kaiyi%20Xu%20&%20Lily%20Tang.pdf Exploiting Lua 5.0.2 bytecode on a Cisco ASA Router by Dbappsecurity Co.,Ltd (2019-09-05)]
* [https://github.com/erezto/lua-patcher LUA 5.1-5.3 bytecode patching tool by erezto (2015-10-19)]
* [https://github.com/erezto/lua-patcher LUA 5.1-5.3 bytecode patching tool by erezto (2015-10-19)]
* [https://github.com/erezto/lua-sandbox-escape/blob/master/x86_64/exploit.lua Lua 5.2 sandbox escape for x86 and x86-64 by erezto (2016-04-27)]
* [https://github.com/erezto/lua-sandbox-escape/blob/master/x86_64/exploit.lua Lua 5.2 sandbox escape for x86 and x86-64 by erezto (2016-04-27)]
Line 1,349: Line 1,336:
==== Tested ====
==== Tested ====
Works on FWs 4.00-4.05. On <= 3.70 FW we have not found a way to leak the target object, but it might be doable as Fail0verflow did it on 1.01.
Works on FWs 4.00-4.05. On <= 3.70 FW we have not found a way to leak the target object, but it might be doable as Fail0verflow did it on 1.01.
----
=== FW <= ?4.05? - amd64_set_ldt Heap Overflow (CVE-2016-1885) ===
==== Credits ====
* 2016-10-25 This vulnerability was discovered and researched by Francisco Falcon from Core Exploit Writers Team
* 2016-10-25 Revised patch to address a problem pointed out by ahaha from Chaitin Tech.
==== Analysis ====
* https://www.freebsd.org/security/advisories/FreeBSD-SA-16:15.sysarch.asc
* https://www.coresecurity.com/core-labs/advisories/freebsd-kernel-amd64setldt-heap-overflow
* https://web.archive.org/web/20161028222346/https://www.securityfocus.com/archive/1/archive/1/537812/100/0/threaded
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-1885
* https://www.mail-archive.com/[email protected]/msg132464.html
* https://svnweb.freebsd.org/base?view=revision&revision=296956
* https://wololo.net/2016/10/26/details-surface-ps4-4-01-jailbreak-potentially-enough-public-release-soon
==== Bug Description ====
The IA-32 architecture allows programs to define segments, which provides based and size-limited view into the program address space. The memory-resident processor structure, called Local Descriptor Table, usually abbreviated LDT, contains definitions of the segments. Since incorrect or malicious segments would breach system integrity, operating
systems do not provide processes direct access to the LDT, instead they provide system calls which allow controlled installation and removal of segments.
A special combination of sysarch(2) arguments, specify a request to uninstall a set of descriptors from the LDT. The start descriptor is cleared and the number of descriptors are provided. Due to lack of sufficient bounds checking during argument validity verification, unbound zero'ing of the process LDT and adjacent memory can be initiated from usermode.
sysarch is syscall #165 on FreeBSD 9.1 and on PS4. Sony removed set_ldt between System Software version 1.76 and 4.05, according to Red-EyeX32.
==== Exploit Implementation ====
==== Patched ====
'''Yes''' in some FW <= 4.05 and >= 2.00 as set_ldt was removed. The PS4 is maybe not vulnerable because of a possible lack of 32bit implementation for syscalls.
==== Tested ====
Not yet.
----
----


Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)