CVE-2022-27942
📋 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
- Tcpreplay
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Fedora by Fedoraproject
Tcpreplay by Broadcom
⚠️ 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.
🎯 Exploit Status
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
allDo not run tcpprep on pcap files from untrusted sources, especially those containing MPLS packets.
Remove MPLS packet processing capability
linuxFilter 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
- https://github.com/appneta/tcpreplay/issues/719
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5B75AFRJUGOYHCFG2ZV2JKSUPA6MSCT5/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ECRCFJ6X3IVB7BT4KS6AHQMSL532YXYD/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JWRZO7BG6DHA5NAC3COB45WFXLYRIERC/
- https://security.gentoo.org/glsa/202210-08
- https://github.com/appneta/tcpreplay/issues/719
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5B75AFRJUGOYHCFG2ZV2JKSUPA6MSCT5/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ECRCFJ6X3IVB7BT4KS6AHQMSL532YXYD/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JWRZO7BG6DHA5NAC3COB45WFXLYRIERC/
- https://security.gentoo.org/glsa/202210-08