[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107671":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":16,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":27,"discoverSource":28},107671,"BD-JB-Relapse","zecoxao\u002FBD-JB-Relapse","zecoxao","BD-JB Relapse for 13.42 and below by zecoxao, EchoStretch and Claude",null,"Java",74,10,2,1,0,3,21,45.72,false,"master",true,[],"2026-11-16 01:24:54","2026-11-23 20:24:38","# BD-JB-Relapse\n\nA **BD-J** (Blu-ray Disc Java) port of the **relapse** PS5 kernel exploit, loaded\nthrough **BD-JB5**. It gains kernel read\u002Fwrite and launches an ELF loader on the\nconsole entirely from Java running inside the Disc Player's BD-J VM — no WebKit entry\npoint required.\n\n**Status:** work in progress, but functional — it leaks the kernel base, gains kernel\nR\u002FW, escalates privileges (uid 0, out of the sandbox) and starts the elfldr payload\nserver.\n\n> BD-J port by **EchoStretch, zecoxao and Claude**, with the close-panic teardown\n> **fixed by 0xXOR**.\n> Original *relapse* exploit from the PS5 research community (WebKit PoC).\n\n**Version:** 2.0.0\n\n## Supported firmware\n\nPS5 firmwares up to and including **13.42**. Per-firmware offset tables are included\nfor **7.00 – 13.60** (`RelapseOffsets.java`); development and testing were done on a\n13.42 devkit.\n\n## How it works\n\nRelapse abuses the `aio_multi_wait` **mode-0 waiter use-after-free** (syscall `663` \u002F\n`0x297` with `mode = 0`). The dangling waiter is reclaimed to corrupt a `sysctl` OID,\nyielding a slow kernel read\u002Fwrite primitive that is then upgraded to a fast\npipe-based R\u002FW. After privilege escalation it hands control to an embedded loader\nchain:\n\n- **kexp** (ufm42) — applies the kernel patches and bootstraps the payload loader.\n- **elfldr** (ps5-payload-dev) — migrates out to a system service and serves ELF\n  payloads on **port 9021**.\n\n## Implementation notes (BD-J port)\n\nPorting the original WebKit\u002FJavaScript exploit to the BD-J VM required working around\nseveral platform constraints on recent firmware:\n\n- **Execute-only `libkernel` `.text`.** Code pages can't be read, so stub scanning\n  and ROP gadget hunting are impossible — syscalls are reached through exported\n  `libkernel` wrappers instead.\n- **The UAF needs `mode = 0`, which the wrappers reject.** `sceKernelAioWaitRequests`\n  validates its arguments and refuses `mode = 0` (`EINVAL`), but that mode is exactly\n  what triggers the waiter UAF. The raw syscall stubs are not exported, yet they\n  physically exist inside **`libkernel_sys`**; the port locates them at runtime by\n  computing fixed offsets from a `dlsym`'d anchor and calls them directly with\n  `mode = 0`.\n- **No generic `syscall()` and no writable JIT before escalation.** `pipe2` is rebuilt\n  from `pipe()` + `fcntl`, and the KASLR source address is obtained via `connect()` +\n  `getsockname` rather than the (unreachable) interface-list APIs.\n- **Clean teardown.** After launching the payload server the exploit gives every\n  crossed pipe back its own buffer and size (saved before the crossing) and\n  empties them, verifying each field through the slow window, so the eventual\n  `pipe_free_kmem()` unmaps the real allocation at process exit. The hijacked\n  `sysctl` OIDs cannot close the window that repairs them, so they are\n  deliberately left modified until the next boot.\n\n## Building\n\nThe project builds a single payload jar (`Relapse.jar`). You need:\n\n- **JDK 8** (`javac` \u002F `jar`) — the sources target `-source 1.4 -target 1.4`, which\n  newer JDKs no longer support.\n- A checkout of [john-tornblom\u002Fbdj-sdk](https:\u002F\u002Fgithub.com\u002Fjohn-tornblom\u002Fbdj-sdk),\n  which ships `enhanced-stubs.zip` and builds `sony-stubs.jar` (`make -C\n  bdj-sdk\u002Ftarget`) under `target\u002Flib\u002F`. These are the same open stubs the `ps5-*`\n  samples compile against — no proprietary firmware jars are required.\n\nWith the SDK built (`sony-stubs.jar` present under `bdj-sdk\u002Ftarget\u002Flib\u002F`):\n\n```sh\nmake BDJSDK_HOME=\u002Fpath\u002Fto\u002Fbdj-sdk JAVA8_HOME=\u002Fpath\u002Fto\u002Fjdk8\n```\n\nOr compile directly with a JDK 8 and the two stub archives in one folder:\n\n```sh\njavac -Xlint:-options -source 1.4 -target 1.4 \\\n  -cp \"enhanced-stubs.zip:sony-stubs.jar\" \\\n  src\u002Forg\u002Fbdj\u002Fapi\u002F*.java src\u002Forg\u002Fbdj\u002F*.java src\u002Forg\u002Fbdj\u002Fexternal\u002F*.java\njar cfm Relapse.jar manifest.txt -C src\u002F .\n```\n\n(On Windows, use `;` instead of `:` in the classpath.) To build against a real\nfirmware `bdjstack.jar` + `rt.jar` instead, pass `CLASSPATH=...` to `make`.\n\nTagged pushes are built automatically by GitHub Actions\n(`.github\u002Fworkflows\u002Frelease.yml`): the workflow provisions JDK 8 and the bdj-sdk\nstubs, builds `Relapse.jar`, then assembles a bootable disc image from\n[Gezine\u002FBD-JB5](https:\u002F\u002Fgithub.com\u002FGezine\u002FBD-JB5) with `Relapse.jar` bundled as\nthe on-disc payload, and attaches both `Relapse.jar` and `BD-JB-Relapse-\u003Ctag>.iso`\nto the matching GitHub release.\n\nThe embedded `kexp_2026_10_26.bin` and `elfldr-ps5-0.27.elf` under\n`src\u002Forg\u002Fbdj\u002Fexternal\u002F` are bundled into the jar automatically.\n\n## Usage\n\nEach release ships two artifacts:\n\n- **`BD-JB-Relapse-\u003Cversion>.iso`** — a bootable BD-RE disc built from BD-JB5 2.0\n  with `Relapse.jar` bundled on the disc as `payload.jar`. Burn it to BD-RE (or\n  serve it however you normally run a BD-J disc) and insert it in the Disc Player.\n  BD-JB5 escapes the BD-J sandbox and its `InternalJarLoader` auto-runs the bundled\n  jar from `\u002Fdisc\u002Fpayload.jar` — **no network push needed.** This is the easiest\n  way to run Relapse.\n- **`Relapse.jar`** — the payload on its own, for the classic flow: load it with\n  BD-JB5's **RemoteJarLoader** (`jar_client.py`, port **9025**).\n\nEither way, once Relapse runs the ELF loader listens on **port 9021** — send your\npayloads there. Progress is reported over the on-console UDP logger (BD-JB5's\nRemoteLogger, port **18194**; run its `log_client.py` first).\n\n## Known issues\n\n- Closing the application after running used to reboot the console: the crossed\n  pipes were torn down with `pipe_buffer.buffer` still pointing at the peer\n  `struct pipe`, so `pipe_free_kmem()` unmapped a UMA object as if it were the\n  pipe's buffer. The teardown now writes both pipes' own buffers and sizes back,\n  zeroes `count`\u002F`in`\u002F`out` and verifies every field by readback before returning.\n  This is the fix measured on firmware 12.60 upstream, but it has not yet been\n  validated on this port's 13.42 target; if a close still panics, reboot and\n  re-run.\n- The three hijacked `sysctl` OIDs remain modified until reboot. In particular\n  `kern.smp.cpus` can return a kernel address instead of the CPU count. Nothing in\n  the post-jailbreak chain has been observed to care.\n- The `sysctl` write window cannot repair the pipes and restore its own OIDs in the\n  same pass: the fast primitive overwrites the pipe field it repairs, and\n  restoring the OIDs destroys the slow window. Repairing the pipes takes priority\n  because their residue is what panics on close.\n\n## Credits & acknowledgements\n\n- **EchoStretch, zecoxao, Claude** — BD-J port.\n- **0xXOR** — close-panic teardown fix (pipe buffer\u002Fsize restore via the slow\n  `sysctl` window).\n- **relapse** — original PS5 kernel exploit (`aio_multi_wait` mode-0 UAF).\n- **ufm42** — [kexp](https:\u002F\u002Fgithub.com\u002Fufm42\u002Fkexp).\n- **ps5-payload-dev** — [elfldr](https:\u002F\u002Fgithub.com\u002Fps5-payload-dev\u002Felfldr).\n- **john-tornblom** — [bdj-sdk](https:\u002F\u002Fgithub.com\u002Fjohn-tornblom\u002Fbdj-sdk).\n- **Gezine** — BD-JB5 loader.\n- **edisnord** — [relapse-y2jb](https:\u002F\u002Fgithub.com\u002Fedisnord\u002Frelapse-y2jb): hardware\n  analysis of the close panic and the pipe-restore method.\n","BD-JB-Relapse 是一个针对 PlayStation 5（固件 13.42 及以下）的 Blu-ray Disc Java（BD-J）平台内核提权漏洞利用工具，将原 WebKit 环境下的 relapse 漏洞移植至 BD-J 虚拟机中运行。其核心功能包括：通过 aio_multi_wait syscall（0x297）的 mode-0 use-after-free 触发内核地址泄露、构建慢速\u002F快速 kernel R\u002FW 原语、绕过 libkernel 执行保护实现 raw syscall 调用、完成 UID 0 权限提升，并启动 ELF 载荷服务（监听端口 9021）。项目专为无 WebKit 入口点的受限 BD-J 环境设计，适用于 PS5 固件研究、安全分析及底层系统调试等场景。","2026-11-24 04:32:35","CREATED_QUERY"]