Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-273 (对于放弃特权的检查不恰当) — Vulnerability Class 12

12 vulnerabilities classified as CWE-273 (对于放弃特权的检查不恰当). AI Chinese analysis included.

CWE-273 represents a critical logic flaw where software attempts to relinquish elevated privileges but fails to verify the success of this operation. This weakness typically arises when developers assume privilege drops are atomic or always succeed without validating the return status. Attackers exploit this by triggering the privilege drop sequence, knowing the system will likely retain root or administrator access if the command fails silently or returns an unexpected error code. Consequently, the application continues running with excessive permissions, allowing unprivileged users to execute arbitrary code or access sensitive resources. To prevent this, developers must rigorously check the return values of all privilege-changing system calls. Implementing strict error handling that terminates the process or logs a fatal alert upon failure ensures the application never operates with unintended elevated rights, thereby maintaining the principle of least privilege.

MITRE CWE Description
The product attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded. If the drop fails, the product will continue to run with the raised privileges, which might provide additional access to unprivileged users.
Common Consequences (2)
Access ControlGain Privileges or Assume Identity
If privileges are not dropped, neither are access rights of the user. Often these rights can be prevented from being dropped.
Access Control, Non-RepudiationGain Privileges or Assume Identity, Hide Activities
If privileges are not dropped, in some cases the system may record actions as the user which is being impersonated rather than the impersonator.
Mitigations (3)
Architecture and DesignCompartmentalize 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 separatio…
ImplementationCheck the results of all functions that return a value and verify that the value is expected.
Effectiveness: High
ImplementationIn 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.
Examples (1)
This code attempts to take on the privileges of a user before creating a file, thus avoiding performing the action with unnecessarily high privileges:
bool DoSecureStuff(HANDLE hPipe) { bool fDataWritten = false; ImpersonateNamedPipeClient(hPipe); HANDLE hFile = CreateFile(...); /../ RevertToSelf() /../ }
Bad · C++

Vulnerabilities classified as CWE-273 (对于放弃特权的检查不恰当) represent 12 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.