CVE-2024-45063

8.8 HIGH

📋 TL;DR

This CVE describes a use-after-free vulnerability in the ctl_write_buffer function that allows malicious software in a guest VM to achieve code execution on the host bhyve process, which typically runs as root. The vulnerability affects FreeBSD systems using bhyve virtualization with virtio_scsi, and potentially iSCSI targets. Attackers could gain root privileges on the host system, though execution is constrained by the Capsicum sandbox.

💻 Affected Systems

Products:
  • FreeBSD
  • NetApp products using affected FreeBSD components
Versions: FreeBSD 13.2-RELEASE before p5, FreeBSD 13.3-RELEASE before p3, FreeBSD 14.0-RELEASE before p4, FreeBSD 14.1-RELEASE before errata 002
Operating Systems: FreeBSD
Default Config Vulnerable: ⚠️ Yes
Notes: Requires bhyve virtualization with virtio_scsi enabled. iSCSI targets using affected code are also vulnerable to remote exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full root compromise of the host system through code execution in the bhyve process, potentially leading to complete host takeover and lateral movement within the infrastructure.

🟠

Likely Case

Privilege escalation from guest VM to host root access, allowing attackers to compromise the virtualization host and potentially other VMs on the same host.

🟢

If Mitigated

Limited impact due to Capsicum sandbox constraints, potentially preventing full system compromise but still allowing bhyve process manipulation.

🌐 Internet-Facing: MEDIUM - iSCSI targets exposed to untrusted networks could be remotely exploited, but requires specific iSCSI initiator configuration.
🏢 Internal Only: HIGH - Guest VMs with malicious software can exploit this locally, making internal virtualization hosts prime targets.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires access to a guest VM or iSCSI initiator. The vulnerability is in kernel space but exploited through userspace bhyve process.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: FreeBSD 13.2-RELEASE p5, 13.3-RELEASE p3, 14.0-RELEASE p4, 14.1-RELEASE errata 002

Vendor Advisory: https://security.freebsd.org/advisories/FreeBSD-SA-24:11.ctl.asc

Restart Required: Yes

Instructions:

1. Update FreeBSD using 'freebsd-update fetch' and 'freebsd-update install'. 2. Rebuild kernel if using custom kernel. 3. Reboot system. 4. For NetApp products, follow NTAP-20240920-0010 advisory.

🔧 Temporary Workarounds

Disable virtio_scsi in bhyve

all

Remove or disable virtio_scsi device passthrough in bhyve configurations to prevent exploitation from guest VMs.

Edit bhyve configuration to remove '-s' options with virtio-scsi
Remove virtio_scsi devices from VM configurations

Restrict iSCSI access

all

Limit iSCSI target exposure to trusted networks only and implement access controls.

Configure firewall rules to restrict iSCSI port 3260/tcp
Implement CHAP authentication for iSCSI connections

🧯 If You Can't Patch

  • Isolate virtualization hosts from critical networks and implement strict network segmentation
  • Monitor bhyve processes for unusual behavior and implement enhanced logging

🔍 How to Verify

Check if Vulnerable:

Check FreeBSD version with 'uname -a' and compare against affected versions. Verify bhyve is running with 'ps aux | grep bhyve'.

Check Version:

uname -a

Verify Fix Applied:

After patching, verify version is updated with 'uname -a' and test bhyve functionality with virtio_scsi.

📡 Detection & Monitoring

Log Indicators:

  • Unusual bhyve process crashes or restarts
  • Kernel panic messages related to memory corruption
  • Failed virtio_scsi operations in system logs

Network Indicators:

  • Unexpected iSCSI connections from untrusted sources
  • Anomalous traffic to iSCSI port 3260

SIEM Query:

process_name:"bhyve" AND (event_type:"crash" OR memory_violation:"use-after-free")

🔗 References

📤 Share & Export