CWE-273 Base Incomplete Medium likelihood

Improper Check for Dropped Privileges

This vulnerability occurs when an application tries to lower its system privileges but fails to verify that the operation was successful.

Definition

What is CWE-273?

This vulnerability occurs when an application tries to lower its system privileges but fails to verify that the operation was successful.
When a program temporarily elevates its permissions to perform a sensitive task, it should reliably revert to a less-privileged state afterward. If the code doesn't properly confirm this privilege drop—perhaps due to a missing error check or a flawed verification logic—the application continues running with its elevated access rights. This creates a critical security gap, as an attacker could potentially exploit the retained high privileges to perform unauthorized actions, access restricted data, or modify system settings. Essentially, the intended security boundary fails, leaving the system exposed to the very risks the privilege drop was meant to prevent.
Real-world impact

Real-world CVEs caused by CWE-273

  • Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.

  • Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.

How attackers exploit it

Step-by-step attacker path

  1. 1

    Identify a code path that handles untrusted input without validation.

  2. 2

    Craft a payload that exercises the unsafe behavior — injection, traversal, overflow, or logic abuse.

  3. 3

    Deliver the payload through a normal request and observe the application's reaction.

  4. 4

    Iterate until the response leaks data, executes attacker code, or escalates privileges.

Vulnerable code example

Vulnerable C++

This code attempts to take on the privileges of a user before creating a file, thus avoiding performing the action with unnecessarily high privileges:

Vulnerable C++
bool DoSecureStuff(HANDLE hPipe) {
  	bool fDataWritten = false;
  	ImpersonateNamedPipeClient(hPipe);
  	HANDLE hFile = CreateFile(...);
  	/../
  	RevertToSelf()
  	/../
  }
Secure code example

Secure pseudo

Secure pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Prevention checklist

How to prevent CWE-273

  • Architecture and Design 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.
  • Implementation Check the results of all functions that return a value and verify that the value is expected.
  • Implementation In Windows, make sure that the process token has the SeImpersonatePrivilege(Microsoft Server 2003). Code that relies on impersonation for security must ensure that the impersonation succeeded, i.e., that a proper privilege demotion happened.
Detection signals

How to detect CWE-273

Automated Static Analysis High

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.)

Plexicus auto-fix

Plexicus auto-detects CWE-273 and opens a fix PR in under 60 seconds.

Codex Remedium scans every commit, identifies this exact weakness, and ships a reviewer-ready pull request with the patch. No tickets. No hand-offs.

Frequently asked questions

Frequently asked questions

What is CWE-273?

This vulnerability occurs when an application tries to lower its system privileges but fails to verify that the operation was successful.

How serious is CWE-273?

MITRE rates the likelihood of exploit as Medium — exploitation is realistic but typically requires specific conditions.

What languages or platforms are affected by CWE-273?

MITRE has not specified affected platforms for this CWE — it can apply across most application stacks.

How can I prevent CWE-273?

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…

How does Plexicus detect and fix CWE-273?

Plexicus's SAST engine matches the data-flow signature for CWE-273 on every commit. When a match is found, our Codex Remedium agent opens a fix PR with the corrected code, tests, and a one-line summary for the reviewer.

Where can I learn more about CWE-273?

MITRE publishes the canonical definition at https://cwe.mitre.org/data/definitions/273.html. You can also reference OWASP and NIST documentation for adjacent guidance.

Ready when you are

Don't Let Security
Weigh You Down.

Stop choosing between AI velocity and security debt. Plexicus is the only platform that runs Vibe Coding Security and ASPM in parallel — one workflow, every codebase.