结构: Simple
Abstraction: Base
状态: Incomplete
被利用可能性: unkown
The elevated privilege level required to perform operations such as chroot() should be dropped immediately after the operation is performed.
cwe_Nature: ChildOf cwe_CWE_ID: 271 cwe_View_ID: 1000 cwe_Ordinal: Primary
cwe_Nature: ChildOf cwe_CWE_ID: 271 cwe_View_ID: 699 cwe_Ordinal: Primary
Language: {'cwe_Class': 'Language-Independent', 'cwe_Prevalence': 'Undetermined'}
范围 | 影响 | 注释 |
---|---|---|
['Access Control', 'Confidentiality'] | ['Gain Privileges or Assume Identity', 'Read Application Data', 'Read Files or Directories'] | An attacker may be able to access resources with the elevated privilege that could not be accessed with the attacker's original privileges. This is particularly likely in conjunction with another flaw, such as a buffer overflow. |
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
策略:
Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
策略: Separation of Privilege
Follow the principle of least privilege when assigning access rights to entities in a software system.
策略: Separation of Privilege
Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design and that the compartmentalization serves to allow for and further reinforce privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide when it is appropriate to use and to drop system privileges.
The following example demonstrates the weakness.
bad C
bad Java
The following code calls chroot() to restrict the application to a subset of the filesystem below APP_HOME in order to prevent an attacker from using the program to gain unauthorized access to files located elsewhere. The code then opens a file specified by the user and processes the contents of the file.
bad C
Constraining the process inside the application's home directory before opening any files is a valuable security measure. However, the absence of a call to setuid() with some non-zero value means the application is continuing to operate with unnecessary root privileges. Any successful exploit carried out by an attacker against the application can now result in a privilege escalation attack because any malicious operations will be performed with the privileges of the superuser. If the application drops to the privilege level of a non-root user, the potential for damage is substantially reduced.
Maintenance CWE-271, CWE-272, and CWE-250 are all closely related and possibly overlapping. CWE-271 is probably better suited as a category. Other
映射的分类名 | ImNode ID | Fit | Mapped Node Name |
---|---|---|---|
7 Pernicious Kingdoms | Least Privilege Violation | ||
CLASP | Failure to drop privileges when reasonable | ||
CERT C Secure Coding | POS02-C | Follow the principle of least privilege | |
The CERT Oracle Secure Coding Standard for Java (2011) | SEC00-J | Do not allow privileged blocks to leak sensitive information across a trust boundary | |
The CERT Oracle Secure Coding Standard for Java (2011) | SEC01-J | Do not allow tainted variables in privileged blocks | |
Software Fault Patterns | SFP36 | Privilege |