CVE-2021-39685

HIGH

Android - Out-of-bounds Write in USB Gadget Subsystem

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2021-39685. PoCs published by szymonh.

AI-analyzed exploit summary This repository contains a functional exploit PoC for CVE-2021-39685, which allows an attacker to read or write up to 65k bytes of kernel memory by exploiting improper handling of wLength in USB gadget control request handlers (rndis, hid, uac1, uac1_legacy, uac2). The provided Python script demonstrates memory dumping and arbitrary write capabilities.

Description

In various setup methods of the USB gadget subsystem, there is a possible out of bounds write due to an incorrect flag check. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.Product: AndroidVersions: Android kernelAndroid ID: A-210292376References: Upstream kernel

Exploits (1)

nomisec WORKING POC 14 stars
by szymonh · poc
https://github.com/szymonh/inspector-gadget

This repository contains a functional exploit PoC for CVE-2021-39685, which allows an attacker to read or write up to 65k bytes of kernel memory by exploiting improper handling of wLength in USB gadget control request handlers (rndis, hid, uac1, uac1_legacy, uac2). The provided Python script demonstrates memory dumping and arbitrary write capabilities.

Classification
Working Poc 95%
Attack Type
Info Leak
Complexity
Moderate
Reliability
Reliable
Target: Linux kernel USB gadget subsystem (versions affected by CVE-2021-39685)
No auth needed
Prerequisites: Physical or logical access to a USB gadget interface on a vulnerable system
devstral-2 · analyzed Feb 19, 2026 Full analysis →

References (1)

Core 1
Core References
Patch, Vendor Advisory x_refsource_misc
https://source.android.com/security/bulletin/2022-03-01

Scores

CVSS v3 7.8
EPSS 0.0046
EPSS Percentile 36.6%
Attack Vector LOCAL
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Details

CWE
CWE-787
Status published
Products (1)
google/android
Published Mar 16, 2022
Tracked Since Feb 18, 2026