CWE-782 无充分访问控制条件下暴露IOCTL

Exposed IOCTL with Insufficient Access Control

结构: Simple

Abstraction: Variant

状态: Draft

被利用可能性: unkown

基本描述

The software implements an IOCTL with functionality that should be restricted, but it does not properly enforce access control for the IOCTL.

扩展描述

When an IOCTL contains privileged functionality and is exposed unnecessarily, attackers may be able to access this functionality by invoking the IOCTL. Even if the functionality is benign, if the programmer has assumed that the IOCTL would only be accessed by a trusted process, there may be little or no validation of the incoming data, exposing weaknesses that would never be reachable if the attacker cannot call the IOCTL directly.

The implementations of IOCTLs will differ between operating system types and versions, so the methods of attack and prevention may vary widely.

相关缺陷

  • cwe_Nature: ChildOf cwe_CWE_ID: 749 cwe_View_ID: 1000 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 749 cwe_View_ID: 699 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 284 cwe_View_ID: 699

  • cwe_Nature: CanPrecede cwe_CWE_ID: 781 cwe_View_ID: 1000

适用平台

Language: [{'cwe_Name': 'C', 'cwe_Prevalence': 'Often'}, {'cwe_Name': 'C++', 'cwe_Prevalence': 'Often'}]

Operating_System: [{'cwe_Class': 'Unix', 'cwe_Prevalence': 'Undetermined'}, {'cwe_Class': 'Windows', 'cwe_Prevalence': 'Undetermined'}]

常见的影响

范围 影响 注释
['Integrity', 'Availability', 'Confidentiality'] Attackers can invoke any functionality that the IOCTL offers. Depending on the functionality, the consequences may include code execution, denial-of-service, and theft of data.

可能的缓解方案

Architecture and Design

策略:

In Windows environments, use proper access control for the associated device or device namespace. See References.

分析过的案例

标识 说明 链接
CVE-2009-2208 Operating system does not enforce permissions on an IOCTL that can be used to modify network settings. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2208
CVE-2008-3831 Device driver does not restrict ioctl calls to its master. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3831
CVE-2008-3525 ioctl does not check for a required capability before processing certain requests. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3525
CVE-2008-0322 Chain: insecure device permissions allows access to an IOCTL, allowing arbitrary memory to be overwritten. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0322
CVE-2007-4277 Chain: anti-virus product uses weak permissions for a device, leading to resultant buffer overflow in an exposed IOCTL. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-4277
CVE-2007-1400 Chain: sandbox allows opening of a TTY device, enabling shell commands through an exposed ioctl. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-1400
CVE-2006-4926 Anti-virus product uses insecure security descriptor for a device driver, allowing access to a privileged IOCTL. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4926
CVE-1999-0728 Unauthorized user can disable keyboard or mouse by directly invoking a privileged IOCTL. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-0728

Notes

Relationship This can be primary to many other weaknesses when the programmer assumes that the IOCTL can only be accessed by trusted parties. For example, a program or driver might not validate incoming addresses in METHOD_NEITHER IOCTLs in Windows environments (CWE-781), which could allow buffer overflow and similar attacks to take place, even when the attacker never should have been able to access the IOCTL at all. Applicable Platform

引用