Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Description

Code

EUID

RUID

SSUID

program Program startup

 

0

userUser

0

temporary Temporary drop

seteuid(getuid())

userUseruser

User

0

restoreRestore

seteuid(0)

0

userUser

0

permanent Permanent drop

setuid(getuid())

userUseruser

User

userUser

restore Restore (attacker)

setuid(0) (fails)

userUseruser

User

userUser

If the program fails to restore privileges, it will be unable to permanently drop them later:

Description

Code

EUID

RUID

SSUID

program startup

 

0

userUser

0

temporary Temporary drop

seteuid(getuid())

userUseruser

User

0

restoreRestore

seteuid(0)

userUseruser

User

0

permanent Permanent drop

setuid(getuid())

userUseruser

User

0

restore Restore (attacker)

setuid(0)

0

0

0

Compliant Solution

...