Bad order of dropping privileges
Dropped higher elevated privileges before dropping lower elevated privileges
Description
This defect occurs when you use functions such as setuid
and
setgid
in the incorrect order, dropping higher elevated
privileges before dropping lower elevated privileges. For example, you drop elevated
primary group privileges before dropping elevated ancillary group privileges.
Risk
If you drop privileges in the wrong order, you can potentially drop higher privileges that you need to drop lower privileges. The incorrect order can mean that privileges are not dropped compromising the security of your program.
Fix
Respect this order of dropping elevated privileges:
Drop (elevated) ancillary group privileges, then drop (elevated) primary group privileges.
Drop (elevated) primary group privileges, then drop (elevated) user privileges.
Examples
Result Information
Group: Security |
Language: C | C++ |
Default: Off |
Command-Line Syntax: BAD_PRIVILEGE_DROP_ORDER |
Impact: High |
Version History
Introduced in R2016b
See Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)