CVE-2023-32247 Overview
A flaw was found in the Linux kernel's ksmbd, a high-performance in-kernel SMB server. The specific flaw exists within the handling of SMB2_SESSION_SETUP commands. The issue results from the lack of control of resource consumption, classified as CWE-401 (Missing Release of Memory after Effective Lifetime). An attacker can leverage this vulnerability to create a denial-of-service condition on the system by exhausting available memory resources through repeated exploitation.
Critical Impact
Remote unauthenticated attackers can cause denial-of-service on systems running ksmbd by sending crafted SMB2_SESSION_SETUP commands, leading to memory exhaustion and system instability.
Affected Products
- Linux Linux Kernel (multiple versions with ksmbd enabled)
- NetApp H300s Storage Systems
- NetApp H410s Storage Systems
- NetApp H500s Storage Systems
- NetApp H700s Storage Systems
Discovery Timeline
- 2023-07-24 - CVE-2023-32247 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2023-32247
Vulnerability Analysis
This vulnerability is a Memory Leak flaw in the Linux kernel's ksmbd module, which provides an in-kernel SMB3 server implementation. The vulnerability exists in the handling of SMB2_SESSION_SETUP commands, where improper resource management allows an attacker to cause memory exhaustion.
The ksmbd module was introduced to provide high-performance SMB file sharing directly within the kernel space, bypassing the traditional userspace Samba implementation. However, this performance optimization comes with increased security risks when vulnerabilities are present, as kernel-level exploits can have more severe consequences than userspace vulnerabilities.
The flaw is network-accessible without requiring authentication or user interaction, making it particularly dangerous for systems exposed to untrusted networks. An attacker can send specially crafted SMB2_SESSION_SETUP requests that trigger memory allocations without corresponding deallocations, progressively consuming system memory until the system becomes unresponsive or crashes.
Root Cause
The root cause of this vulnerability lies in CWE-401: Missing Release of Memory after Effective Lifetime. When processing SMB2_SESSION_SETUP commands in ksmbd, the code fails to properly release allocated memory in certain error paths or session handling scenarios. This creates a memory leak that can be triggered repeatedly by an attacker, eventually exhausting available system memory. The lack of proper resource consumption controls allows unbounded memory allocation, which should be prevented through proper limits and cleanup routines.
Attack Vector
The attack can be executed remotely over the network against any system with ksmbd enabled and accessible. The attack flow involves:
- The attacker identifies a target system with ksmbd SMB server running (typically on port 445)
- The attacker sends multiple malformed or specially crafted SMB2_SESSION_SETUP commands
- Each command triggers memory allocation that is not properly released
- Repeated requests progressively exhaust system memory
- Eventually, the system experiences denial-of-service due to memory exhaustion
Since the attack requires no authentication and no user interaction, it can be automated and executed at scale against vulnerable systems. The vulnerability affects the SMB session establishment phase, meaning it can be triggered before any authentication takes place.
Detection Methods for CVE-2023-32247
Indicators of Compromise
- Unusual memory consumption growth on systems running ksmbd
- High volume of SMB2_SESSION_SETUP requests from single or multiple sources
- System performance degradation or unresponsiveness on SMB servers
- Kernel memory allocation warnings or out-of-memory (OOM) killer activation
- Abnormal network traffic patterns targeting port 445
Detection Strategies
- Monitor ksmbd process memory usage for unusual growth patterns
- Implement network intrusion detection rules for anomalous SMB2_SESSION_SETUP traffic
- Deploy rate limiting on SMB connections to detect and throttle potential attacks
- Configure system resource monitoring with alerts for memory exhaustion thresholds
- Use kernel audit logging to track ksmbd module activity and session handling
Monitoring Recommendations
- Enable SMB protocol logging and analyze for repeated failed session setup attempts
- Monitor system memory metrics with alerting for sustained memory growth without corresponding release
- Track network connections to ksmbd for unusual connection patterns or high request rates
- Implement baseline monitoring for normal ksmbd memory footprint to detect deviations
- Review kernel logs for ksmbd-related warnings or errors
How to Mitigate CVE-2023-32247
Immediate Actions Required
- Disable ksmbd if not required for operations and use userspace Samba instead
- Restrict network access to SMB services using firewall rules to trusted networks only
- Apply available kernel patches from your Linux distribution
- Monitor affected systems for signs of exploitation or memory exhaustion
- Implement network segmentation to limit exposure of SMB services
Patch Information
Patches for this vulnerability are available through Linux kernel updates. System administrators should apply security updates from their respective Linux distributions. For NetApp appliances, refer to NetApp Security Advisory NTAP-20230915-0011 for specific firmware updates. Additional information is available in the Red Hat Bug Report #2219803 and the Zero Day Initiative ZDI-CAN-20478 Advisory.
Workarounds
- Disable ksmbd module if not essential: modprobe -r ksmbd
- Use traditional userspace Samba server instead of in-kernel ksmbd
- Implement firewall rules to restrict SMB access to trusted IP ranges only
- Deploy an intrusion prevention system (IPS) with rules to detect and block SMB exploitation attempts
- Consider using VPN or other network security controls to limit SMB service exposure
# Configuration example - Disable ksmbd and block SMB access
# Disable ksmbd kernel module
sudo modprobe -r ksmbd
# Prevent ksmbd from loading on boot
echo "blacklist ksmbd" | sudo tee /etc/modprobe.d/blacklist-ksmbd.conf
# Restrict SMB port access with iptables (allow only trusted network)
sudo iptables -A INPUT -p tcp --dport 445 -s 192.168.1.0/24 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 445 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


