CVE-2021-32286

7.8 HIGH

📋 TL;DR

CVE-2021-32286 is a critical buffer overflow vulnerability in hcxtools that allows remote code execution when processing malicious pcapng files. Attackers can exploit this by tricking users into opening specially crafted packet capture files. This affects all users of hcxtools versions through 6.1.6.

💻 Affected Systems

Products:
  • hcxtools
Versions: All versions through 6.1.6
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability is in the pcapngoptionwalk function in hcxpcapngtool.c and affects all installations processing pcapng files.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with attacker gaining root privileges and persistent access to the system.

🟠

Likely Case

Local privilege escalation or remote code execution when processing untrusted pcapng files.

🟢

If Mitigated

Denial of service or application crash if exploit fails or is blocked by security controls.

🌐 Internet-Facing: MEDIUM - Requires user interaction to open malicious files, but could be delivered via web downloads.
🏢 Internal Only: MEDIUM - Internal users could be tricked into opening malicious files from internal sources.

🎯 Exploit Status

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

Proof of concept available in GitHub issue #155. Exploitation requires user to process malicious pcapng file.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.1.7 and later

Vendor Advisory: https://github.com/ZerBea/hcxtools/issues/155

Restart Required: No

Instructions:

1. Update hcxtools to version 6.1.7 or later using package manager. 2. For manual installation: git clone repository, build with make, install with sudo make install.

🔧 Temporary Workarounds

Restrict pcapng file processing

linux

Limit hcxtools execution to trusted users and restrict processing of untrusted pcapng files.

chmod 750 /usr/bin/hcxpcapngtool
setfacl -m u:trusteduser:rx /usr/bin/hcxpcapngtool

🧯 If You Can't Patch

  • Remove hcxtools from production systems if not essential
  • Implement strict file validation and sandboxing for pcapng processing

🔍 How to Verify

Check if Vulnerable:

Run: hcxpcapngtool --version | grep -q '6\.1\.[0-6]' && echo 'VULNERABLE'

Check Version:

hcxpcapngtool --version

Verify Fix Applied:

Run: hcxpcapngtool --version | grep -q '6\.1\.[7-9]\|6\.[2-9]\|7\.[0-9]' && echo 'PATCHED'

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault errors in system logs
  • Abnormal process termination of hcxpcapngtool

Network Indicators:

  • Unexpected network connections after pcapng file processing
  • Suspicious downloads of pcapng files

SIEM Query:

process_name='hcxpcapngtool' AND (event_type='segfault' OR exit_code=139)

🔗 References

📤 Share & Export