CVE-2022-27942

7.8 HIGH

📋 TL;DR

CVE-2022-27942 is a heap-based buffer over-read vulnerability in tcpprep utility of Tcpreplay 4.4.1. This allows attackers to read sensitive memory contents, potentially leading to information disclosure or application crashes. Systems running vulnerable versions of Tcpreplay are affected.

💻 Affected Systems

Products:
  • Tcpreplay
Versions: Tcpreplay 4.4.1 specifically; earlier versions may also be affected but not confirmed
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers when tcpprep processes MPLS-encapsulated packets in pcap files.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution through memory corruption leading to complete system compromise, though this requires specific exploitation conditions beyond simple buffer over-read.

🟠

Likely Case

Application crash (denial of service) or information disclosure of sensitive memory contents from the tcpprep process.

🟢

If Mitigated

Limited impact with proper memory protection mechanisms (ASLR, DEP) and network segmentation.

🌐 Internet-Facing: MEDIUM - Requires tcpprep to process malicious network traffic, which is less common for internet-facing services.
🏢 Internal Only: MEDIUM - Internal systems using tcpprep for network testing/traffic replay could be vulnerable if processing malicious pcap files.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting malicious pcap files with MPLS packets that trigger the buffer over-read in parse_mpls function.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Tcpreplay 4.4.2 or later

Vendor Advisory: https://github.com/appneta/tcpreplay/issues/719

Restart Required: No

Instructions:

1. Check current version: tcpreplay --version
2. Update via package manager: sudo apt update && sudo apt upgrade tcpreplay (Debian/Ubuntu) or sudo yum update tcpreplay (RHEL/CentOS)
3. Verify update: tcpreplay --version should show 4.4.2 or higher

🔧 Temporary Workarounds

Avoid processing untrusted pcap files

all

Do not run tcpprep on pcap files from untrusted sources, especially those containing MPLS packets.

Remove MPLS packet processing capability

linux

Filter or strip MPLS packets from pcap files before processing with tcpprep.

tcpdump -r input.pcap -w output.pcap 'not mpls'

🧯 If You Can't Patch

  • Restrict tcpprep usage to trusted users only via sudoers or access controls
  • Implement network segmentation to limit potential impact if exploitation occurs

🔍 How to Verify

Check if Vulnerable:

Run: tcpreplay --version | grep -q '4.4.1' && echo 'VULNERABLE' || echo 'NOT VULNERABLE'

Check Version:

tcpreplay --version

Verify Fix Applied:

Run: tcpreplay --version | grep -q '4.4.2\|4.4.3\|4.5' && echo 'PATCHED' || echo 'STILL VULNERABLE'

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault or crash logs from tcpprep process
  • Unexpected memory access errors in system logs

Network Indicators:

  • Unusual network traffic generation from tcpreplay tools
  • Multiple failed tcpprep executions

SIEM Query:

process_name:"tcpprep" AND (event_type:"crash" OR exit_code:139)

🔗 References

📤 Share & Export