CWE-271: Privilege Dropping / Lowering Errors
The product does not drop privileges before passing control of a resource to an actor that does not have those privileges.
View on MITREExtended Description
In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.
Technical Details
- Structure
- Simple
Applicable To
Security Consequences
Scope
Impact
If privileges are not dropped, neither are access rights of the user. Often these rights can be prevented from being dropped.
Scope
Impact
If privileges are not dropped, in some cases the system may record actions as the user which is being impersonated rather than the impersonator.
Mitigation Strategies
No mitigation information available for this CWE.
Detection Methods
No detection method information available for this CWE.
Code Examples & CVEs
Demonstrative Examples
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.
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.
Observed CVE Examples (13)
Setuid program does not drop privileges after a parsing error occurs, then calls another program to handle the error.
View DetailsFinger daemon does not drop privileges when executing programs on behalf of the user being fingered.
View DetailsFTP server does not drop privileges if a connection is aborted during file transfer.
View DetailsWindows program running as SYSTEM does not drop privileges before executing other programs (many others like this, especially involving the Help facility).
View DetailsUtility Manager launches winhlp32.exe while running with raised privileges, which allows local users to gain system privileges.
View DetailsSetuid program does not drop privileges before executing program specified in an environment variable.
View DetailsSetuid program does not drop privileges before processing file specified on command line.
View DetailsService on Windows does not drop privileges before using "view file" option, allowing code execution.
View DetailsCWE Relationships
Frequently Asked Questions
What is CWE-271: Privilege Dropping / Lowering Errors?+
CWE-271: Privilege Dropping / Lowering Errors is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product does not drop privileges before passing control of a resource to an actor that does not have those privileges. In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.
What are the security consequences of Privilege Dropping / Lowering Errors?+
If exploited, CWE-271 (Privilege Dropping / Lowering Errors) it can compromise Access Control and Non-Repudiation, leading to outcomes such as Gain Privileges or Assume Identity and Hide Activities.
Which programming languages are affected by Privilege Dropping / Lowering Errors?+
CWE-271 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
What are real-world examples of Privilege Dropping / Lowering Errors?+
MITRE documents real CVEs mapped to CWE-271, including CVE-2000-1213, CVE-2001-0559, CVE-2001-0787, CVE-2002-0080 and CVE-2001-1029. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.
What is the difference between a CWE and a CVE?+
A CWE (Common Weakness Enumeration) like CWE-271 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.