CVE-2020-27402
The HK1 TV Box ships a setuid-like su binary that any local user can execute, so an attacker with adb or UART access can become root. Once root, they can read WiFi passwords, cookies, tokens and other private data.
sick.codes
Published on sick.codes
The HK1 Box S905X3 TV Box contains a vulnerability that allows a local unprivileged user, such as a malicious APK, to escalate to root using the /system/xbin/su binary. While connected to the device through the serial port (UART), or while using adb as an unprivileged user, the local attacker can execute the…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The su binary is executable by all users (mode 755) and /sbin/su is group-executable (750), so an unprivileged shell user can invoke it to gain root.
Impact
A local attacker could become root and steal social networking tokens, WiFi passwords, cookies, saved passwords, location data, messages, emails and contacts, or use the box to sniff other devices on the same network.
What the attacker needed
Local access via adb or UART serial port
The fix
The su binaries should be restricted so that only the intended privileged user can execute them, for example by changing their permissions to 700.
How it was found
- Connect to the device via adb or the UART serial port.
- Confirm you are the unprivileged shell user.
- Run /system/xbin/su.
- Confirm you are now root.
- Read the WiFi password from the configuration file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This TV box lets anyone who can plug in a cable or use its debugging tool run a special program called su, which is meant to switch to the all-powerful root user. Because the program is not locked down, the attacker becomes root without a password and can read everything stored on the device.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.