658
According to SOAR, the following detection techniques may be useful: Cost effective for partial
coverage: Source code Weakness Analyzer Context-configured Source Code Weakness
Analyzer
Effectiveness = SOAR Partial
Automated Static Analysis
According to SOAR, the following detection techniques may be useful: Cost effective for partial
coverage: Permission Manifest Analysis
Effectiveness = SOAR Partial
Architecture or Design Review
According to SOAR, the following detection techniques may be useful: Highly cost effective:
Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.) Formal
Methods / Correct-By-Construction Cost effective for partial coverage: Attack Modeling
Effectiveness = High
Potential Mitigations
Phase: Architecture and Design
Phase: Operation
Very carefully manage the setting, management, and handling of privileges. Explicitly manage
trust zones in the software.
Phase: Architecture and Design
Strategy = Separation of Privilege
Follow the principle of least privilege when assigning access rights to entities in a software
system.
Phase: Architecture and Design
Strategy = Separation of Privilege
Compartmentalize the system to have "safe" areas where trust boundaries can be
unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always
be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate
compartmentalization is built into the system design, and the compartmentalization allows for and
reinforces privilege separation functionality. Architects and designers should rely on the principle
of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
Demonstrative Examples
Example 1:
The following example demonstrates the weakness.
Example Language: C (Bad)
setuid(0);
// Do some important stuff
setuid(old_uid);
// Do some non privileged stuff.
Example 2:
The following example demonstrates the weakness.
Example Language: Java (Bad)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
// privileged code goes here, for example:
CWE Version 4.14
CWE-272: Least Privilege Violation
CWE-272: Least Privilege Violation