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
Overview
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.
Real-world CVEs
10 recorded CVEs are caused by CWE-271 (Privilege Dropping / Lowering Errors). The highest-severity and most recent are shown first. 2 new CWE-271 CVEs have been recorded so far in 2026 (2 in 2025).
- CVE-2023-22648High · CVSS 8.8 · EPSS 38th2023-06-01
- CVE-2019-11243High · CVSS 8.1 · EPSS 72th2019-04-22
- CVE-2024-0985
PostgreSQL non-owner REFRESH MATERIALIZED VIEW CONCURRENTLY executes arbitrary SQL
High · CVSS 8.0 · EPSS 77th2024-02-08 - CVE-2025-53819
Nix's privilege dropping to build user broke for macOS
High · CVSS 7.9 · EPSS 2th2025-07-14 - CVE-2026-35535High · CVSS 7.8 · EPSS 7th2026-04-03
- CVE-2022-3569High · CVSS 7.8 · EPSS 51th2022-10-17
- CVE-2025-23395
Local root exploit via `logfile_reopen()` in screen 5.0.0 with setuid-root bit set
High · CVSS 7.3 · EPSS 10th2025-05-26 - CVE-2024-35179Medium · CVSS 6.8 · EPSS 47th2024-05-15
- CVE-2026-25704
Incomplete privilege drop for com.system76.CosmicGreeter.GetUserData
Medium · CVSS 5.8 · EPSS 0th2026-03-30 - CVE-2020-35513Medium · CVSS 4.9 · EPSS 69th2021-01-25
Common consequences
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.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to prevent it
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.
Code examples
Illustrative examples from MITRE showing how the weakness appears 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);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.
Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2000-1213 — Program does not drop privileges after acquiring the raw socket.
- CVE-2001-0559 — Setuid program does not drop privileges after a parsing error occurs, then calls another program to handle the error.
- CVE-2001-0787 — Does not drop privileges in related groups when lowering privileges.
- CVE-2002-0080 — Does not drop privileges in related groups when lowering privileges.
- CVE-2001-1029 — Does not drop privileges before determining access to certain files.
- CVE-1999-0813 — Finger daemon does not drop privileges when executing programs on behalf of the user being fingered.
- CVE-1999-1326 — FTP server does not drop privileges if a connection is aborted during file transfer.
- CVE-2000-0172 — Program only uses seteuid to drop privileges.
- CVE-2004-2504 — Windows program running as SYSTEM does not drop privileges before executing other programs (many others like this, especially involving the Help facility).
- CVE-2004-0213 — Utility Manager launches winhlp32.exe while running with raised privileges, which allows local users to gain system privileges.
- CVE-2004-0806 — Setuid program does not drop privileges before executing program specified in an environment variable.
- CVE-2004-0828 — Setuid program does not drop privileges before processing file specified on command line.
- CVE-2004-2070 — Service on Windows does not drop privileges before using "view file" option, allowing code execution.
Terminology & mappings
Mapped taxonomies
- PLOVER: Privilege Dropping / Lowering Errors
Frequently asked questions
Common questions about CWE-271.
- What is CWE-271?
- The product does not drop privileges before passing control of a resource to an actor that does not have those privileges.
- What CVEs are caused by CWE-271?
- 10 recorded CVEs are attributed to CWE-271, including CVE-2023-22648, CVE-2019-11243, CVE-2024-0985.
- How do you prevent CWE-271?
- 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.
- What are the consequences of CWE-271?
- Exploiting CWE-271 can lead to: Gain Privileges or Assume Identity, Hide Activities.
- Is CWE-271 actively exploited?
- 10 recorded CVEs are caused by CWE-271; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-271) (opens in a new tab)
- CWE-271 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-271
Get alerted the moment a new CWE-271 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.