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.
Last updated
The product does not drop privileges before passing control of a resource to an actor that does not have those privileges.
Last updated
CWE-271 (Privilege Dropping / Lowering Errors) is a class-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
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.
12 recorded CVEs are caused by CWE-271 (Privilege Dropping / Lowering Errors), including 1 in CISA's KEV (Known Exploited Vulnerabilities) catalog. KEVs are shown first. 2 new CWE-271 CVEs have been recorded so far in 2026 (2 in 2025).
Linux Kernel Improper Privilege Management Vulnerability
Rancher's Azure AD permission changes are not reflected on active sessions
Kubernetes did not effectively clear service account credentials
PostgreSQL non-owner REFRESH MATERIALIZED VIEW CONCURRENTLY executes arbitrary SQL
Nix's privilege dropping to build user broke for macOS
sudo: Sudo: Privilege escalation due to failure in privilege drop calls
Local root exploit via `logfile_reopen()` in screen 5.0.0 with setuid-root bit set
Unprivileged Stalwart Mail Server user can read files as root
Apptainer's ineffective privileges drop when requesting container network
Incomplete privilege drop for com.system76.CosmicGreeter.GetUserData
kernel: Nfsd failure to clear umask after processing an open or create
What can happen when CWE-271 is exploited.
Gain Privileges or Assume Identity
Affects: Access Control
If privileges are not dropped, neither are access rights of the user. Often these rights can be prevented from being dropped.
Gain Privileges or Assume Identity, Hide Activities
Affects: Access Control, Non-Repudiation
If privileges are not dropped, in some cases the system may record actions as the user which is being impersonated rather than the impersonator.
Typically introduced during these phases of the software lifecycle.
Practical mitigations for CWE-271, grouped by where in the lifecycle they apply.
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 the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
Consider following the principle of separation of privilege. Require multiple conditions to be met before permitting access to a system resource.
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.)
MITRE examples of the weakness in code.
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.
Vulnerable example
chroot(APP_HOME);
chdir("/");
FILE* data = fopen(argv[1], "r+");
...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.
Real CVEs that MITRE cites as examples of this weakness.
Common questions about CWE-271.
Weakness data is sourced from the MITRE CWE catalog (v4.21). CVE associations are aggregated and kept current by RadicalNotion.AI.
Get an alert when a new CWE-271 CVE affects your products, with AI-written analysis and remediation steps.