Audit · 8 min
Two lines, and one order is a vulnerability
Generated when asked for a helper that drops root before doing untrusted work.
void drop_privilege(uid_t uid, gid_t gid) {
if (setuid(uid) != 0) {
_exit(1);
}
if (setgid(gid) != 0) {
_exit(1);
}
}Before it runs
What is wrong with this?