The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.

Primary

Architecture and Design

Implementation
REALIZATION: This weakness is caused during implementation of an architectural security tactic.

Operation

Medium

Access Control
Gain Privileges or Assume Identity

Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
High

Architecture and Design
Operation
Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.

Architecture and Design
Separation of Privilege
Follow the principle of least privilege when assigning access rights to entities in a software system.

Architecture and Design
Separation of Privilege
Consider following the principle of separation of privilege. Require multiple conditions to be met before permitting access to a system resource.

This code temporarily raises the program's privileges to allow creation of a new user folder.

def makeNewUserDir(username):
if invalidUsername(username):

#avoid CWE-22 and CWE-78
print('Usernames cannot contain invalid characters')return False

try:raisePrivileges()os.mkdir('/home/' + username)lowerPrivileges()
except OSError:print('Unable to create new user directory for user:' + username)return False
return True

While the program only raises its privilege level to create the folder and immediately lowers it again, if the call to os.mkdir() throws an exception, the call to lowerPrivileges() will not occur. As a result, the program is indefinitely operating in a raised privilege state, possibly allowing further exploitation to occur.

The following example demonstrates the weakness.

seteuid(0);
/* do some stuff */

seteuid(getuid());

The following example demonstrates the weakness.

AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
// privileged code goes here, for example:
System.loadLibrary("awt");return null;
// nothing to return

}

This code intends to allow only Administrators to print debug information about a system.

public enum Roles {ADMIN,USER,GUEST}
public void printDebugInfo(User requestingUser){
if(isAuthenticated(requestingUser)){
switch(requestingUser.role){
case GUEST:System.out.println("You are not authorized to perform this command");break;
default:System.out.println(currentDebugState());break;

}
}else{System.out.println("You must be logged in to perform this command");}
}

While the intention was to only allow Administrators to print the debug information, the code as written only excludes those with the role of "GUEST". Someone with the role of "ADMIN" or "USER" will be allowed access, which goes against the original intent. An attacker may be able to use this debug information to craft an attack on the system.

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.

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;}
}

else{System.out.println("You must be logged in to perform this command");}
}

This code does not check the role of the user whose password is being reset. It is possible for an Operator to gain Admin privileges by resetting the password of an Admin account and taking control of that account.

CVE-2001-1555
Terminal privileges are not reset when a user logs out.
https://www.cve.org/CVERecord?id=CVE-2001-1555

CVE-2001-1514
Does not properly pass security context to child processes in certain cases, allows privilege escalation.
https://www.cve.org/CVERecord?id=CVE-2001-1514

CVE-2001-0128
Does not properly compute roles.
https://www.cve.org/CVERecord?id=CVE-2001-0128

CVE-1999-1193
untrusted user placed in unix "wheel" group
https://www.cve.org/CVERecord?id=CVE-1999-1193

CVE-2005-2741
Product allows users to grant themselves certain rights that can be used to escalate privileges.
https://www.cve.org/CVERecord?id=CVE-2005-2741

CVE-2005-2496
Product uses group ID of a user instead of the group, causing it to run with different privileges. This is resultant from some other unknown issue.
https://www.cve.org/CVERecord?id=CVE-2005-2496

CVE-2004-0274
Product mistakenly assigns a particular status to an entity, leading to increased privileges.
https://www.cve.org/CVERecord?id=CVE-2004-0274

CVE-2007-4217
FTP client program on a certain OS runs with setuid privileges and has a buffer overflow. Most clients do not need extra privileges, so an overflow is not a vulnerability for those clients.
https://www.cve.org/CVERecord?id=CVE-2007-4217

CVE-2007-5159
OS incorrectly installs a program with setuid privileges, allowing users to gain privileges.
https://www.cve.org/CVERecord?id=CVE-2007-5159

CVE-2008-4638
Composite: application running with high privileges (CWE-250) allows user to specify a restricted file to process, which generates a parsing error that leaks the contents of the file (CWE-209).
https://www.cve.org/CVERecord?id=CVE-2008-4638

CVE-2007-3931
Installation script installs some programs as setuid when they shouldn't be.
https://www.cve.org/CVERecord?id=CVE-2007-3931

CVE-2002-1981
Roles have access to dangerous procedures (Accessible entities).
https://www.cve.org/CVERecord?id=CVE-2002-1981

CVE-2002-1671
Untrusted object/method gets access to clipboard (Accessible entities).
https://www.cve.org/CVERecord?id=CVE-2002-1671

CVE-2000-0315
Traceroute program allows unprivileged users to modify source address of packet (Accessible entities).
https://www.cve.org/CVERecord?id=CVE-2000-0315

CVE-2000-0506
User with capability can prevent setuid program from dropping privileges (Unsafe privileged actions).
https://www.cve.org/CVERecord?id=CVE-2000-0506

Privilege Management Error

Part 2-4
Req SP.03.08 BR

Part 3-2
Req CR 3.1

Part 3-3
Req SR 1.2

Part 3-3
Req SR 2.1

Part 4-1
Req SD-3

Part 4-1
Req SD-4

Part 4-1
Req SI-1

Part 4-2
Req CR 1.1

Part 4-2
Req CR 2.1

Discouraged
CWE-269 is commonly misused. It can be conflated with "privilege escalation," which is a technical impact that is listed in many low-information vulnerability reports [REF-1287]. It is not useful for trend analysis.
If an error or mistake allows privilege escalation, then use the CWE ID for that mistake. Avoid using CWE-269 when only phrases such as "privilege escalation" or "gain privileges" are available, as these indicate technical impact of the vulnerability - not the root cause weakness. If the root cause seems to be directly related to privileges, then examine the children of CWE-269 for additional hints, such as Execution with Unnecessary Privileges (CWE-250) or Incorrect Privilege Assignment (CWE-266).

The relationships between privileges, permissions, and actors (e.g. users and groups) need further refinement within the Research view. One complication is that these concepts apply to two different pillars, related to control of resources (CWE-664) and protection mechanism failures (CWE-693).

PLOVER
2006-07-19
Draft 3
2006-07-19

Eric Dalci
Cigital
2008-07-01
updated Time_of_Introduction

CWE Team
2008-09-08
Moved this entry higher up in the Research view.

CWE Content Team
MITRE
2008-09-08
updated Description, Maintenance_Notes, Name, Relationships, Taxonomy_Mappings, Weakness_Ordinalities

CWE Content Team
MITRE
2009-05-27
updated Name

CWE Content Team
MITRE
2009-12-28
updated Potential_Mitigations

CWE Content Team
MITRE
2010-06-21
updated Potential_Mitigations

CWE Content Team
MITRE
2011-03-29
updated Description, Relationships

CWE Content Team
MITRE
2011-06-01
updated Common_Consequences

CWE Content Team
MITRE
2012-05-11
updated References, Relationships

CWE Content Team
MITRE
2012-10-30
updated Potential_Mitigations

CWE Content Team
MITRE
2013-02-21
updated Potential_Mitigations

CWE Content Team
MITRE
2017-11-08
updated Applicable_Platforms, Causal_Nature, Modes_of_Introduction, Relationships, Type

CWE Content Team
MITRE
2019-06-20
updated Related_Attack_Patterns, Relationships

CWE Content Team
MITRE
2019-09-19
updated Demonstrative_Examples, Maintenance_Notes, Observed_Examples, Relationships

CWE Content Team
MITRE
2020-02-24
updated Observed_Examples, Relationships

CWE Content Team
MITRE
2020-08-20
updated Relationships

CWE Content Team
MITRE
2021-03-15
updated Demonstrative_Examples

CWE Content Team
MITRE
2021-10-28
updated Relationships

CWE Content Team
MITRE
2022-04-28
updated Relationships

CWE Content Team
MITRE
2022-10-13
updated References

CWE Content Team
MITRE
2023-01-31
updated Description

CWE Content Team
MITRE
2023-04-27
updated Detection_Factors, Relationships

CWE Content Team
MITRE
2023-06-29
updated Mapping_Notes, Relationships, Taxonomy_Mappings

CWE Content Team
MITRE
2024-07-16
4.15
2024-07-16
updated Diagram

CWE Content Team
MITRE
2024-11-19
4.16
2024-11-19
updated Relationships

CWE Content Team
MITRE
2025-12-11
4.19
2025-12-11
updated Relationships

CWE Content Team
MITRE
2026-01-21
4.19.1
2026-01-21
updated Relationships

"Mapping CWE to 62443" Sub-Working Group
CWE-CAPEC ICS/OT SIG
2023-06-29
4.12
2023-06-29
Suggested mappings to ISA/IEC 62443.

Abhi Balakrishnan
2024-02-29
4.15
2024-07-16
Provided diagram to improve CWE usability

Privilege Management Error
Insecure Privilege Management