Skip to content

Unchecked Return Values for Privilege Drop

Description

These functions may be used to either drop or change account privileges. If the calls fail, the process will continue to run with the privileges assigned to it on start. Depending on the logic of the application, this may allow attackers to abuse the system due to privileges never being changed to a different access level. Always ensure return values of this function are checked to determine if the application should continue to operate.

Examples

Insecure Code

c
RpcImpersonateClient(); // without checking return value

Secure Code

c
if (!RpcImpersonateClient()) { /* handle error */ }

Remediation

Check the return values of the functions to ensure the application handles failed privilege drops correctly.

Rule Details

FieldValue
IDCODE-0559
CategoryAccessControl
SeverityHIGH
CWECWE-250
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsprivilege drop, access control
OWASPA5:2017-Broken Access Control, A01:2021-Broken Access Control