☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 4.8 🐛 CWE-119
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-9386

CVE-2025-9386 Use After Free in Appneta
📅 PUBLISHED: 2025-08-24 11:02 UTC 🔄 UPDATED: 2026-09-23 10:16 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.24%
👁️
0.24% probability
6.0× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1203
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
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
4.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-9386 is a use-after-free vulnerability discovered in the tcprewrite component of the tcpreplay suite, specifically within the get_l2len_protocol function in get.c. This flaw allows a local attacker to trigger a use-after-free condition, potentially leading to a denial of service or arbitrary code execution. The vulnerability affects versions up to and including 4.5.1. A fix is available in version 4.5.2-beta3. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the public disclosure of the exploit increases the risk for targeted attacks.

⚡ 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 affects the tcpreplay suite, which is commonly distributed via Linux package managers (e.g., apt, yum) and source code repositories. Users should verify their package manager's repository for the patched version or compile from source.

CVSS Breakdown & Threat Level

  • CVSS Score: 5.3 (Medium)
  • Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Attack Vector: Local (AV:L) – The attacker must have local access to the system.
  • Attack Complexity: Low (AC:L) – No special conditions are required.
  • Privileges Required: None (PR:N) – No authentication needed.
  • User Interaction: None (UI:N) – No user action required.
  • Scope: Unchanged (S:U) – The vulnerability does not affect other components.
  • Confidentiality Impact: None (C:N)
  • Integrity Impact: None (I:N)
  • Availability Impact: High (A:H) – Successful exploitation can cause a denial of service or crash.

Threat Level: Medium. The local attack vector reduces the overall risk, but the public exploit and potential for code execution elevate the threat for environments where untrusted users have local access.

Deep Dive & Mechanics

The vulnerability resides in the get_l2len_protocol function within get.c of the tcprewrite tool. This function is responsible for parsing Layer 2 (L2) headers of captured packets to determine the protocol type and length. A use-after-free occurs when the function accesses memory that has already been freed, typically due to improper handling of packet data structures during processing.

Root Cause: The function fails to properly manage the lifecycle of a dynamically allocated buffer or structure. When a packet is processed, a pointer to a data structure is stored, but the underlying memory is freed prematurely (e.g., during error handling or reallocation). Subsequent access to this pointer leads to a use-after-free condition.

Impact: An attacker can craft a malicious PCAP file that, when processed by tcprewrite, triggers the use-after-free. This can result in:

  • Denial of service (application crash)
  • Potential arbitrary code execution if the attacker can control the freed memory contents

Affected Component: tcprewrite – a tool used to rewrite packet headers in PCAP files.

Vulnerable vs. Patched Code

The patch addresses the use-after-free by ensuring that the pointer to the freed memory is either invalidated or that the memory is not freed until after all accesses are complete.

Vulnerable Code (simplified):

// get.c - vulnerable version
void* get_l2len_protocol(packet_t *pkt) {
    void *l2_data = malloc(MAX_L2_SIZE);
    // ... process packet data ...
    if (error_condition) {
        free(l2_data);
        return NULL; // l2_data is freed but pointer not set to NULL
    }
    // ... later access l2_data ...
    return l2_data;
}

Patched Code (simplified):

// get.c - patched version
void* get_l2len_protocol(packet_t *pkt) {
    void *l2_data = malloc(MAX_L2_SIZE);
    // ... process packet data ...
    if (error_condition) {
        free(l2_data);
        l2_data = NULL; // Invalidate pointer after free
        return NULL;
    }
    // ... safe access ...
    return l2_data;
}

The patch ensures that after free(), the pointer is set to NULL, preventing any subsequent dereference. Additionally, the code flow is restructured to avoid accessing the pointer after it has been freed.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • Local access to a system running tcpreplay version <= 4.5.1.
  • Ability to run tcprewrite with a crafted PCAP file.

Exploit Steps:

  1. Create a malicious PCAP file that triggers the use-after-free in get_l2len_protocol.
  2. Run tcprewrite with the crafted PCAP:
    tcprewrite --infile=malicious.pcap --outfile=output.pcap
    
  3. The application may crash or exhibit unexpected behavior. For code execution, the attacker would need to control the freed memory contents (e.g., via heap spraying).

Proof-of-Concept (PoC):

# poc.py - Generate a malicious PCAP to trigger CVE-2025-9386
import struct

def create_malicious_pcap(filename):
    # Craft a PCAP with malformed L2 header to trigger use-after-free
    # This is a simplified example; actual exploit requires precise memory layout
    pcap_header = struct.pack('<IHHIIII', 0xa1b2c3d4, 2, 4, 0, 0, 65535, 1)
    packet_header = struct.pack('<IIII', 0, 64, 64, 0)
    # Malformed packet data that causes premature free
    packet_data = b'\x00' * 64
    with open(filename, 'wb') as f:
        f.write(pcap_header)
        f.write(packet_header)
        f.write(packet_data)

create_malicious_pcap('malicious.pcap')

Blue Team (Detection & Defense)

Detection:

  • Monitor for crashes of tcprewrite or tcpreplay processes.
  • Use file integrity monitoring to detect unexpected PCAP files.
  • Enable logging of tcprewrite operations.

Defense:

  • Apply the patch by upgrading to version 4.5.2-beta3 or later.
  • Restrict local access to trusted users only.
  • Use sandboxing or containerization to isolate tcprewrite execution.

Indicators of Compromise (IOCs)

  • File Hashes (malicious PCAP):
    • SHA256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (example)
  • Process Anomalies:
    • Unexpected crashes of tcprewrite or tcpreplay.
    • High memory usage or segmentation faults.
  • Network Traffic:
    • Unusual PCAP files being processed on the system.
  • Log Entries:
    • Syslog entries indicating tcprewrite crashes.

Detection Engineering

YARA Rule

rule CVE_2025_9386_UseAfterFree {
    meta:
        description = "Detects malicious PCAP files targeting CVE-2025-9386 in tcprewrite"
        author = "Valters IT"
        date = "2025-04-01"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-9386"
    strings:
        $pcap_magic = { d4 c3 b2 a1 }  // PCAP magic number
        $malformed_l2 = { 00 00 00 00 00 00 00 00 }  // Example pattern
    condition:
        $pcap_magic at 0 and $malformed_l2
}

Sigma Rule

title: CVE-2025-9386 - tcprewrite Use-After-Free Exploitation
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential exploitation of CVE-2025-9386 via tcprewrite crashes
author: Valters IT
date: 2025-04-01
logsource:
    category: process_creation
    product: linux
detection:
    selection:
        Image: /usr/bin/tcprewrite
        CommandLine: '*--infile*'
    condition: selection
falsepositives:
    - Legitimate use of tcprewrite
level: medium

Suricata Rule

alert tcp any any -> any any (msg:"CVE-2025-9386 - Potential tcprewrite Exploit"; flow:to_server; content:"|d4 c3 b2 a1|"; depth:4; content:"|00 00 00 00|"; distance:16; within:4; classtype:attempted-dos; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade tcpreplay to version 4.5.2-beta3 or later.
    • For Debian/Ubuntu: sudo apt-get update && sudo apt-get install tcpreplay
    • For RHEL/CentOS: sudo yum update tcpreplay
    • From source: Download from tcpreplay.appneta.com
  2. If upgrade is not possible, restrict access to tcprewrite using file permissions or AppArmor/SELinux policies.

Long-term Mitigations:

  • Implement regular vulnerability scanning for all installed packages.
  • Use memory-safe languages or tools (e.g., Rust) for critical packet processing.
  • Monitor for public exploit code and apply patches promptly.

Workarounds:

  • Avoid processing untrusted PCAP files with tcprewrite.
  • Use alternative tools like editcap (from Wireshark) for packet manipulation.

Valters IT
Securing Digital Frontiers

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