☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-68656

CVE-2025-68656 Use After Free in Espressif
📅 PUBLISHED: 2026-01-12 17:23 UTC 🔄 UPDATED: 2026-09-23 20:25 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.21%
👁️
0.21% probability
5.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
6.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-68656 is a critical use-after-free vulnerability in the Espressif ESP-IDF USB Host HID (Human Interface Device) Driver. The flaw resides in the usb_class_request_get_descriptor() function, which improperly handles memory when an oversized descriptor is requested. The function frees and reallocates the hid_device->ctrl_xfer buffer but continues to use a stale local pointer, leading to an immediate use-after-free condition. An attacker with physical USB access or the ability to inject a malicious HID device can trigger this vulnerability by sending a crafted Report Descriptor length, potentially leading to arbitrary code execution or denial of service. The vulnerability affects all versions prior to 1.1.0, and the patch is available in version 1.1.0.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a firmware-level issue in the Espressif ESP-IDF framework, specifically in the USB Host HID Driver component. Organizations using ESP32 or other Espressif chips with USB Host capabilities should verify their ESP-IDF version and apply the patch.

CVSS Breakdown & Threat Level

  • CVSS Score: 6.8 (Medium)
  • Attack Vector: Local (AV:L) – Requires physical USB access or a malicious HID device.
  • Attack Complexity: Low (AC:L) – No special conditions required.
  • Privileges Required: None (PR:N) – No authentication needed.
  • User Interaction: Required (UI:R) – The user must connect the malicious HID device.
  • Scope: Unchanged (S:U) – The vulnerability affects only the vulnerable component.
  • Confidentiality Impact: High (C:H) – Potential for memory disclosure.
  • Integrity Impact: High (I:H) – Potential for memory corruption.
  • Availability Impact: High (A:H) – Potential for crash or denial of service.

Threat Level: Medium. While the CVSS score is 6.8, the requirement for physical USB access reduces the attack surface. However, in environments where USB devices are frequently connected (e.g., IoT hubs, kiosks), the risk is elevated.

Deep Dive & Mechanics

The vulnerability is in the usb_class_request_get_descriptor() function within the ESP-IDF USB Host HID Driver. When a HID device sends a request for a descriptor with an oversized length, the function performs the following flawed sequence:

  1. Initial Allocation: A buffer hid_device->ctrl_xfer is allocated to handle the control transfer.
  2. Oversized Request: The function detects that the requested descriptor length exceeds the current buffer size.
  3. Free and Reallocate: The function frees the old hid_device->ctrl_xfer buffer and allocates a new, larger one.
  4. Stale Pointer Usage: The function continues to use a local pointer that still points to the old (freed) memory location. This pointer is used to process the incoming Report Descriptor data.
  5. Use-After-Free: Writing to the stale pointer corrupts freed memory, which can be reallocated by other parts of the system, leading to arbitrary code execution or a crash.

The attacker controls the Report Descriptor length, making this a trivially exploitable condition once a malicious HID device is connected.

Vulnerable vs. Patched Code

Vulnerable Code (pre-1.1.0):

// Simplified vulnerable code
void usb_class_request_get_descriptor(hid_device_t *hid_device, uint16_t length) {
    uint8_t *local_ptr = hid_device->ctrl_xfer;  // Stale pointer
    if (length > HID_DESCRIPTOR_MAX_SIZE) {
        free(hid_device->ctrl_xfer);
        hid_device->ctrl_xfer = malloc(length);
        // local_ptr still points to old freed memory
    }
    // Use local_ptr to write descriptor data
    memcpy(local_ptr, descriptor_data, length);  // Use-after-free
}

Patched Code (1.1.0):

// Simplified patched code
void usb_class_request_get_descriptor(hid_device_t *hid_device, uint16_t length) {
    if (length > HID_DESCRIPTOR_MAX_SIZE) {
        free(hid_device->ctrl_xfer);
        hid_device->ctrl_xfer = malloc(length);
        // Update local pointer after reallocation
    }
    uint8_t *local_ptr = hid_device->ctrl_xfer;  // Safe pointer
    memcpy(local_ptr, descriptor_data, length);
}

The fix ensures that the local pointer is updated after the reallocation, preventing the use-after-free.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A physical USB device capable of acting as a HID device (e.g., a Raspberry Pi Pico or an Arduino with USB HID capabilities).
  • The target device running ESP-IDF with the vulnerable USB Host HID Driver (version < 1.1.0).

Exploitation Steps:

  1. Craft Malicious HID Device: Program a microcontroller to act as a HID device that sends a descriptor request with an oversized length (e.g., 0xFFFF).
  2. Connect to Target: Plug the malicious HID device into the target's USB port.
  3. Trigger Vulnerability: The target's usb_class_request_get_descriptor() function will free and reallocate the buffer, then write to the stale pointer.
  4. Achieve Code Execution: By carefully controlling the heap layout, an attacker can overwrite function pointers or other critical data structures to gain arbitrary code execution.

Example Payload (Conceptual):

// Arduino sketch for a malicious HID device
void setup() {
    // Initialize USB HID
    // Send a descriptor request with oversized length
    uint8_t descriptor_request[] = {0x80, 0x06, 0x00, 0x22, 0x00, 0x00, 0xFF, 0xFF};
    // This triggers the use-after-free
}

Blue Team (Defense & Detection)

Detection:

  • Monitor USB device enumeration logs for anomalous descriptor lengths.
  • Use heap integrity checks (e.g., AddressSanitizer) during development.
  • Implement runtime checks for buffer size consistency.

Mitigation:

  • Update to ESP-IDF USB Host HID Driver version 1.1.0 or later.
  • Restrict physical USB access to trusted devices only.
  • Use USB port blockers or disable USB Host functionality if not needed.

Indicators of Compromise (IOCs)

  • Network: No network-based IOCs; this is a local USB attack.
  • Host:
    • Unexpected crashes or reboots when connecting USB HID devices.
    • Heap corruption errors in system logs.
    • Unusual memory allocation patterns in the USB HID driver.
  • File System: No specific file artifacts.
  • Registry: Not applicable (embedded system).

Detection Engineering

YARA Rule

rule CVE_2025_68656_UseAfterFree {
    meta:
        description = "Detects use-after-free pattern in ESP-IDF USB HID driver"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2025-68656"
    strings:
        $code1 = "usb_class_request_get_descriptor" ascii
        $code2 = "ctrl_xfer" ascii
        $code3 = "free" ascii
        $code4 = "malloc" ascii
    condition:
        all of ($code1, $code2, $code3, $code4) and #code3 > 1
}

Sigma Rule

title: CVE-2025-68656 Use-After-Free in ESP-IDF USB HID Driver
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects potential exploitation of CVE-2025-68656 via anomalous USB descriptor requests
author: Valters IT
logsource:
    product: embedded
    service: usb
detection:
    selection:
        EventID: 1001  # Example USB event ID
        DescriptorLength: "> 0xFFFF"  # Oversized descriptor
    condition: selection
falsepositives:
    - Legitimate oversized descriptors (rare)
level: high

Suricata Rule

alert udp any any -> any any (msg:"CVE-2025-68656 Potential USB HID Exploit"; content:"|80 06 00 22 00 00 FF FF|"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Update Firmware: Upgrade the ESP-IDF USB Host HID Driver to version 1.1.0 or later.
  2. Disable USB Host: If USB Host functionality is not required, disable it in the firmware configuration.
  3. Physical Security: Restrict physical access to USB ports on devices running vulnerable firmware.

Long-Term Measures:

  • Implement code reviews focusing on memory management in USB drivers.
  • Use static analysis tools to detect use-after-free vulnerabilities.
  • Enable heap protection features (e.g., guard pages, canaries) in the RTOS.

Patch Verification:

  • Check the version of esp-idf-usb-host-hid in your project's idf_component.yml or CMakeLists.txt.
  • Ensure the version is >= 1.1.0.

Valters IT
DevSecOps & Cyber Threat Intelligence

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-68656/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.