Skip to content
vetkitChecksChangelogDocumentation

vetkit.c.privilege.unchecked-setuid

The result of setuid / setgid / setgroups is ignored; if the call fails the program keeps running with elevated privileges.

Last updated:

Suite: Security

c, cpp

The result of setuid / setgid / setgroups is ignored; if the call fails the program keeps running with elevated privileges.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Check every privilege-changing call and abort on failure, e.g. if (setuid(uid) != 0) { perror("setuid"); exit(1); }.

References

Source: packages/engine/rules/sast/c.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.