Skip to content

CWE-273: Improper Check for Dropped Privileges

BaseLikelihood of exploit: Medium

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.

Consequences

  • Access Control: Gain Privileges or Assume Identity
  • Access Control, Non-Repudiation: Gain Privileges or Assume Identity, Hide Activities

How to prevent it

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

Recent advisories

  • GHSA-x9r9-c232-4q39 — Hugging Face Transformers downloads custom generation code before trust consent
  • GHSA-5r6c-gj4g-r697 — PraisonAI: SecurityPolicy command/path/import restrictions are completely unenforced by the default SubprocessSandbox backend
  • CVE-2024-38813 — The vCenter Server contains a privilege escalation vulnerability.
  • GHSA-7fpj-9hr8-28vh — Keycloak vulnerable to impersonation via logout token exchange
  • GO-2024-2707 — Mattermost Server Improper Access Control
  • GHSA-748r-5r8q-273m — Apache Superset allows authenticated users to access metadata they have no permission to
  • GHSA-g9m2-c2x5-fr2v — Moodle does not revoke role capabilities correctly

All advisories for CWE-273

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor