At the code layer, the weakness is CWE-252 - an unchecked return value from a
function. But at the application layer, the function is used to drop privileges, so
CWE-273 also applies - improper check for dropped privileges.
To illustrate vulnerability theory in action, the following code will be used in subsequent