Limiting the scope of transitions
For security reasons, Linux systems can reduce the ability of processes to gain elevated privileges under certain situations or provide additional constraints to reduce the likelihood of vulnerabilities to be exploitable. SELinux developers, too, honor these situations.
Sanitizing environments on transition
When we execute a higher-privileged command (be it a setuid
application or one where capabilities are added to the session), the GNU C library (glibc) will sanitize the environment. This means that a set of security-sensitive environment variables are discarded to make sure that attackers, malicious persons, or malicious applications cannot negatively influence the session.
This secure execution is controlled through an Executable and Linkable Format (ELF) auxiliary vector called AT_SECURE. When set, environment variables such as LD_PRELOAD
, LD_AUDIT
, LD_DEBUG
, TMPDIR
, and NLSPATH
are removed from the session.
SELinux will force this...