Description
Executing commands or loading libraries from an untrusted source or in an untrusted environment can cause an application to execute malicious commands (and payloads) on behalf of an attacker.
Process control vulnerabilities take two forms: Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.
Potential Impact
Confidentiality, Integrity, Availability
Execute Unauthorized Code or Commands
Demonstrative Examples
...System.loadLibrary("library.dll");......RegQueryValueEx(hkey, "APPHOME",0, 0, (BYTE*)home, &size);char* lib=(char*)malloc(strlen(home)+strlen(INITLIB));if (lib) {
strcpy(lib,home);strcat(lib,INITCMD);LoadLibrary(lib);
}...LoadLibrary("liberty.dll");Mitigations & Prevention
Libraries that are loaded should be well understood and come from a trusted source. The application can execute code contained in the native libraries, which often contain calls that are susceptible to other security problems, such as buffer overflows or command injection. All native libraries should be validated to determine if the application requires the use of the library. It is very difficult to determine what these native libraries actually do, and the potential for malicious code is high.
Detection Methods
- Automated Static Analysis High — Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then sea
Related Weaknesses
Taxonomy Mappings
- 7 Pernicious Kingdoms: — Process Control
Frequently Asked Questions
What is CWE-114?
CWE-114 (Process Control) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Class-level weakness. Executing commands or loading libraries from an untrusted source or in an untrusted environment can cause an application to execute malicious commands (and payloads) on behalf of an attacker.
How can CWE-114 be exploited?
Attackers can exploit CWE-114 (Process Control) to execute unauthorized code or commands. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-114?
Key mitigations include: Libraries that are loaded should be well understood and come from a trusted source. The application can execute code contained in the native libraries, which often contain calls that are susceptible t
What is the severity of CWE-114?
CWE-114 is classified as a Class-level weakness (High abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.