AttackFlow Findings Dictionary

Finding A Way To Try AttackFlow Enterprise Edition?

If so, click to download 15 days full version for free!

Impersonation In Code

The attacker can force the application run in unwanted high privileged state

Severity

Medium

Fix Cost

High

Trust Level

Medium

Impersonation allows applications to run in another user privilege and if used correctly can reduce the attack surface of an application drastically by limiting the code that needs higher privilege than the current one to execute successfully.

As an example an application that uses windows authentication may want to execute certain parts of the code by using the privilege level of the current user as opposed to IIS application identity.

Here’s a code snippet, which needs a higher privilege than the current user to read a sensitive file, impersonating and then reverse the impersonation.

                                     
try{
impersonatedUser = WindowsIdentity.GetCurrent().Impersonate();
ReadFile();
impersonatedUser.Undo();
}
catch(IOException e){
// logging
return;
}
            
            

Here the problem is that if an exception occurs while reading the file (the file isn’t there, memory problems, etc.) the de-impersonation will not be executed and the process will be still running with the higher permissions.

Finding A Way To Purchase AttackFlow Enterprise Edition?

If so, click to buy now for yearly subscriptions!