645
Language : Not Language-Specific (Prevalence = Undetermined)
Likelihood Of Exploit
High
Common Consequences
Scope Impact Likelihood
Access Control Gain Privileges or Assume Identity
A user can be given or gain access rights of another user.
This can give the user unauthorized access to sensitive
information including the access information of another
user.
Potential Mitigations
Phase: Architecture and Design
Strategy = Separation of Privilege
Consider following the principle of separation of privilege. Require multiple conditions to be met
before permitting access to a system resource.
Phase: Architecture and Design
Phase: Operation
Very carefully manage the setting, management, and handling of privileges. Explicitly manage
trust zones in the software.
Phase: Architecture and Design
Phase: Operation
Strategy = Environment Hardening
Run your code using the lowest privileges that are required to accomplish the necessary tasks
[REF-76]. If possible, create isolated accounts with limited privileges that are only used for a
single task. That way, a successful attack will not immediately give the attacker access to the
rest of the software or its environment. For example, database applications rarely need to run as
the database administrator, especially in day-to-day operations.
Demonstrative Examples
Example 1:
This code allows someone with the role of "ADMIN" or "OPERATOR" to reset a user's password.
The role of "OPERATOR" is intended to have less privileges than an "ADMIN", but still be able to
help users with small issues such as forgotten passwords.
Example Language: Java (Bad)
public enum Roles {
ADMIN,OPERATOR,USER,GUEST
}
public void resetPassword(User requestingUser, User user, String password ){
if(isAuthenticated(requestingUser)){
switch(requestingUser.role){
case GUEST:
System.out.println("You are not authorized to perform this command");
break;
case USER:
System.out.println("You are not authorized to perform this command");
break;
default:
setPassword(user,password);
break;
}
CWE Version 4.14
CWE-269: Improper Privilege Management
CWE-269: Improper Privilege Management