Improper privilege management
Privilege escalation occurs when a malicious user exploits a bug, design flaw, or configuration error in an application or operating system to gain elevated access to the system. Elevated privileges can be used to delete files, view private information, or install unwanted programs or backdoors.
def set_user_noncompliant():
    import os
    root = 0
    # Noncompliant: the process user is set to root.
    os.setuid(root)
def set_user_compliant():
    import os
    root = 4
    # Compliant: the process user is set to userid 4.
    os.setuid(root)