CWE-648: Incorrect Use of Privileged APIs
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
The product does not conform to the API requirements for a function call that requires extra privileges. This could allow attackers to gain privileges by causing the function to be called incorrectly.
常见后果
影响范围: Access Control
技术影响: Gain Privileges or Assume Identity
说明: An attacker may be able to elevate privileges.
影响范围: Confidentiality
技术影响: Read Application Data
说明: An attacker may be able to obtain sensitive information.
影响范围: Integrity Confidentiality Availability
技术影响: Execute Unauthorized Code or Commands
说明: An attacker may be able to execute code.
潜在缓解措施
阶段: Implementation
描述: Before calling privileged APIs, always ensure that the assumptions made by the privileged code hold true prior to making the call.
阶段: Architecture and Design
描述: Know architecture and implementation weaknesses of the privileged APIs and make sure to account for these weaknesses before calling the privileged APIs to ensure that they can be called safely.
阶段: Implementation
描述: If privileged APIs make certain assumptions about data, context or state validity that are passed by the caller, the calling code must ensure that these assumptions have been validated prior to making the call.
阶段: Implementation
描述: If privileged APIs do not shed their privilege prior to returning to the calling code, then calling code needs to shed these privileges immediately and safely right after the call to the privileged APIs. In particular, the calling code needs to ensure that a privileged thread of execution will never be returned to the user or made available to user-controlled processes.
阶段: Implementation
描述: Only call privileged APIs from safe, consistent and expected state.
阶段: Implementation
描述: Ensure that a failure or an error will not leave a system in a state where privileges are not properly shed and privilege escalation is possible (i.e. fail securely with regards to handling of privileges).
观察示例
参考: CVE-2003-0645
A Unix utility that displays online help files, if installed setuid, could allow a local attacker to gain privileges when a particular file-opening function is called.
引入模式
| 阶段 | 说明 |
|---|---|
| Architecture and Design | - |
| Implementation | - |
| Operation | - |
适用平台
编程语言
关键信息
CWE ID: CWE-648
抽象级别: Base
结构: Simple
状态: Incomplete
利用可能性: Low