CVE-2021-47476: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: comedi: ni_usb6501: fix NULL-deref in command paths The driver uses endpoint-sized USB transfer buffers but had no sanity checks on the sizes. This can lead to zero-size-pointer dereferences or overflowed transfer buffers in ni6501_port_command() and ni6501_counter_command() if a (malicious) device has smaller max-packet sizes than expected (or when doing descriptor fuzz testing). Add the missing sanity checks to probe().
AI Analysis
Technical Summary
CVE-2021-47476 is a vulnerability identified in the Linux kernel specifically within the comedi subsystem's ni_usb6501 driver. This driver handles USB communication for certain National Instruments USB-6501 devices. The vulnerability arises because the driver uses USB transfer buffers sized according to the endpoint's maximum packet size but lacks proper sanity checks on these sizes during command processing. If a malicious USB device presents smaller max-packet sizes than expected or if descriptor fuzzing is performed, this can lead to zero-size pointer dereferences or buffer overflows in the functions ni6501_port_command() and ni6501_counter_command(). Essentially, the driver assumes the USB endpoint buffer sizes are valid and does not verify them, which can cause memory corruption or crashes when handling malformed or malicious USB descriptors. The fix involves adding missing sanity checks in the probe() function to validate endpoint sizes before use, preventing these unsafe memory operations. The CVSS 3.1 score is 4.6 (medium severity), with the vector indicating the attack vector is physical (AV:P), low attack complexity (AC:L), no privileges required (PR:N), no user interaction (UI:N), unchanged scope (S:U), no confidentiality or integrity impact (C:N/I:N), but a high impact on availability (A:H) due to potential crashes or denial of service. No known exploits are currently in the wild. This vulnerability is relevant to Linux kernel versions containing the affected driver code prior to the patch date (May 22, 2024).
Potential Impact
For European organizations, the primary impact of CVE-2021-47476 is the risk of denial of service on Linux systems using the ni_usb6501 driver. This could cause system instability or crashes when interacting with malicious or malformed USB devices. While the attack vector requires physical access to connect a malicious USB device, this is a realistic threat in environments with shared or public physical access, such as industrial control systems, research labs, or manufacturing facilities using National Instruments hardware. The vulnerability does not compromise confidentiality or integrity directly but can disrupt availability of critical systems. Organizations relying on Linux-based data acquisition or control systems with ni_usb6501 devices could face operational downtime or require system reboots, impacting productivity and safety. Given the low complexity and no need for privileges or user interaction, an attacker with physical access can exploit this vulnerability easily. However, the requirement for physical presence limits remote exploitation risks. Overall, the threat is moderate but significant for environments where availability and system stability are critical and physical security is not tightly controlled.
Mitigation Recommendations
To mitigate CVE-2021-47476, European organizations should: 1) Apply the latest Linux kernel updates that include the patch adding sanity checks to the ni_usb6501 driver, ensuring the vulnerability is remediated. 2) Implement strict physical security controls to prevent unauthorized personnel from connecting USB devices to sensitive systems, including locked server rooms and restricted access to industrial or laboratory equipment. 3) Employ USB device whitelisting or port control solutions to restrict USB device types allowed on critical systems, preventing connection of untrusted devices. 4) Monitor system logs and kernel messages for unusual USB device behavior or crashes related to the ni_usb6501 driver to detect potential exploitation attempts. 5) For environments where patching is delayed, consider disabling or unloading the ni_usb6501 driver if the hardware is not in use to eliminate the attack surface. 6) Educate staff about the risks of connecting unknown USB devices to critical Linux systems. These targeted mitigations go beyond generic advice by focusing on the specific driver, physical access controls, and operational monitoring relevant to this vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain, Belgium, Switzerland
CVE-2021-47476: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: comedi: ni_usb6501: fix NULL-deref in command paths The driver uses endpoint-sized USB transfer buffers but had no sanity checks on the sizes. This can lead to zero-size-pointer dereferences or overflowed transfer buffers in ni6501_port_command() and ni6501_counter_command() if a (malicious) device has smaller max-packet sizes than expected (or when doing descriptor fuzz testing). Add the missing sanity checks to probe().
AI-Powered Analysis
Technical Analysis
CVE-2021-47476 is a vulnerability identified in the Linux kernel specifically within the comedi subsystem's ni_usb6501 driver. This driver handles USB communication for certain National Instruments USB-6501 devices. The vulnerability arises because the driver uses USB transfer buffers sized according to the endpoint's maximum packet size but lacks proper sanity checks on these sizes during command processing. If a malicious USB device presents smaller max-packet sizes than expected or if descriptor fuzzing is performed, this can lead to zero-size pointer dereferences or buffer overflows in the functions ni6501_port_command() and ni6501_counter_command(). Essentially, the driver assumes the USB endpoint buffer sizes are valid and does not verify them, which can cause memory corruption or crashes when handling malformed or malicious USB descriptors. The fix involves adding missing sanity checks in the probe() function to validate endpoint sizes before use, preventing these unsafe memory operations. The CVSS 3.1 score is 4.6 (medium severity), with the vector indicating the attack vector is physical (AV:P), low attack complexity (AC:L), no privileges required (PR:N), no user interaction (UI:N), unchanged scope (S:U), no confidentiality or integrity impact (C:N/I:N), but a high impact on availability (A:H) due to potential crashes or denial of service. No known exploits are currently in the wild. This vulnerability is relevant to Linux kernel versions containing the affected driver code prior to the patch date (May 22, 2024).
Potential Impact
For European organizations, the primary impact of CVE-2021-47476 is the risk of denial of service on Linux systems using the ni_usb6501 driver. This could cause system instability or crashes when interacting with malicious or malformed USB devices. While the attack vector requires physical access to connect a malicious USB device, this is a realistic threat in environments with shared or public physical access, such as industrial control systems, research labs, or manufacturing facilities using National Instruments hardware. The vulnerability does not compromise confidentiality or integrity directly but can disrupt availability of critical systems. Organizations relying on Linux-based data acquisition or control systems with ni_usb6501 devices could face operational downtime or require system reboots, impacting productivity and safety. Given the low complexity and no need for privileges or user interaction, an attacker with physical access can exploit this vulnerability easily. However, the requirement for physical presence limits remote exploitation risks. Overall, the threat is moderate but significant for environments where availability and system stability are critical and physical security is not tightly controlled.
Mitigation Recommendations
To mitigate CVE-2021-47476, European organizations should: 1) Apply the latest Linux kernel updates that include the patch adding sanity checks to the ni_usb6501 driver, ensuring the vulnerability is remediated. 2) Implement strict physical security controls to prevent unauthorized personnel from connecting USB devices to sensitive systems, including locked server rooms and restricted access to industrial or laboratory equipment. 3) Employ USB device whitelisting or port control solutions to restrict USB device types allowed on critical systems, preventing connection of untrusted devices. 4) Monitor system logs and kernel messages for unusual USB device behavior or crashes related to the ni_usb6501 driver to detect potential exploitation attempts. 5) For environments where patching is delayed, consider disabling or unloading the ni_usb6501 driver if the hardware is not in use to eliminate the attack surface. 6) Educate staff about the risks of connecting unknown USB devices to critical Linux systems. These targeted mitigations go beyond generic advice by focusing on the specific driver, physical access controls, and operational monitoring relevant to this vulnerability.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-05-22T06:20:56.200Z
- Cisa Enriched
- true
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 682d9833c4522896dcbe9246
Added to database: 5/21/2025, 9:09:07 AM
Last enriched: 6/30/2025, 1:28:57 PM
Last updated: 8/14/2025, 7:48:23 PM
Views: 11
Related Threats
CVE-2025-9356: Stack-based Buffer Overflow in Linksys RE6250
HighCVE-2025-9355: Stack-based Buffer Overflow in Linksys RE6250
HighCVE-2025-43761: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Liferay Portal
MediumCVE-2025-24902: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in LabRedesCefetRJ WeGIA
CriticalCVE-2025-52451: CWE-20 Improper Input Validation in Salesforce Tableau Server
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.