677
Phase: Architecture and Design
Phase: Operation
Very carefully manage the setting, management, and handling of privileges. Explicitly manage
trust zones in the software.
Demonstrative Examples
Example 1:
This function is part of a privileged program that takes input from users with potentially lower
privileges.
Example Language: Python (Bad)
def killProcess(processID):
os.kill(processID, signal.SIGKILL)
This code does not confirm that the process to be killed is owned by the requesting user, thus
allowing an attacker to kill arbitrary processes.
This function remedies the problem by checking the owner of the process before killing it:
Example Language: Python (Good)
def killProcess(processID):
user = getCurrentUser()
#Check process owner against requesting user
if getProcessOwner(processID) == user:
os.kill(processID, signal.SIGKILL)
return
else:
print("You cannot kill a process you don't own")
return
Observed Examples
Reference Description
CVE-1999-1125 Program runs setuid root but relies on a configuration file owned by a non-root
user.
https://www.cve.org/CVERecord?id=CVE-1999-1125
Affected Resources
• File or Directory
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 944 SFP Secondary Cluster: Access Management 888 2393
MemberOf 1396 Comprehensive Categorization: Access Control 1400 2519
Notes
Maintenance
The relationships between privileges, permissions, and actors (e.g. users and groups) need
further refinement within the Research view. One complication is that these concepts apply to
two different pillars, related to control of resources (CWE-664) and protection mechanism failures
(CWE-693).
Taxonomy Mappings
CWE Version 4.14
CWE-283: Unverified Ownership
CWE-283: Unverified Ownership