|Name ||Leverage Executable Code in Non-Executable Files |
|Summary ||An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality.
The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control. |
|Prerequisites ||The attacker must have the ability to modify non-executable files consumed by the target software. |
|Solutions ||Design: Enforce principle of least privilege
Design: Run server interfaces with a non-root account and/or utilize chroot jails or other configuration techniques to constrain privileges even if attacker gains some limited access to commands.
Implementation: Perform testing such as pen-testing and vulnerability scanning to identify directories, programs, and interfaces that grant direct access to executables.
Implementation: Implement host integrity monitoring to detect any unwanted altering of configuration files.
Implementation: Ensure that files that are not required to execute, such as configuration files, are not over-privileged, i.e. not allowed to execute. |
|CWE ID ||Description |
|CWE-59 ||Improper Link Resolution Before File Access ('Link Following') |
|CWE-94 ||Improper Control of Generation of Code ('Code Injection') |
|CWE-95 ||Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') |
|CWE-96 ||Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection') |
|CWE-97 ||Improper Neutralization of Server-Side Includes (SSI) Within a Web Page |
|CWE-264 || |
|CWE-270 ||Privilege Context Switching Error |
|CWE-272 ||Least Privilege Violation |
|CWE-275 || |
|CWE-282 ||Improper Ownership Management |
|CWE-714 || |