The elevated privilege level required to perform operations such as chroot() should be dropped immediately after the operation is performed.
Impact: Gain Privileges or Assume IdentityRead Application DataRead Files or Directories
An attacker may be able to access resources with the elevated privilege that could not be accessed with the attacker's original privileges. This is particularly likely in conjunction with another flaw, such as a buffer overflow.
Strategy: Separation of Privilege
Strategy: Separation of Privilege
c
// Do some important stuff* setuid(old_uid);
cjava
// privileged code goes here, for example:* System.loadLibrary("awt"); return null;
javac