Arbitrary code execution
In computer security, arbitrary code execution is an attacker's ability to run any commands or code of the attacker's choice on a target machine or in a target process. An arbitrary code execution vulnerability is a security flaw in software or hardware allowing arbitrary code execution. A program that is designed to exploit such a vulnerability is called an arbitrary code execution exploit. The ability to trigger arbitrary code execution over a network is often referred to as remote code execution.
Arbitrary code execution signifies that if someone sends a specially designed set of data to a computer, they can make it do whatever they want. Even though this particular weakness may not cause actual problems in the real world, researchers have discussed whether it suggests a natural tendency for computers to have vulnerabilities that allow unauthorized code execution.
Vulnerability types
There are a number of classes of vulnerability that can lead to an attacker's ability to execute arbitrary commands or code. For example:- Memory safety vulnerabilities such as buffer overflows or over-reads.
- Deserialization vulnerabilities
- Type confusion vulnerabilities
- GNU arbitrary code execution
Methods
Combining with privilege escalation
On its own, an arbitrary code execution exploit will give the attacker the same privileges as the target process that is vulnerable. For example, if exploiting a flaw in a web browser, an attacker could act as the user, performing actions such as modifying personal computer files or accessing banking information, but would not be able to perform system-level actions.To work around this, once an attacker can execute arbitrary code on a target, there is often an attempt at a privilege escalation exploit in order to gain additional control. This may involve the kernel itself or an account such as Administrator, SYSTEM, or root. With or without this enhanced control, exploits have the potential to do severe damage or turn the computer into a zombie—but privilege escalation helps with hiding the attack from the legitimate administrator of the system.
Examples
hobbyists have managed to find vulnerabilities in classic video games that allow them to execute arbitrary code, usually using a precise sequence of button inputs in a tool-assisted superplay to cause a buffer overflow, allowing them to write to protected memory. At Awesome Games Done Quick 2014, a group of speedrunners managed to code and run versions of the games Pong, Snake and Super Mario Bros. on a copy of Super Mario World by utilizing an out-of-bounds read of a function pointer that points to a user controlled buffer to execute arbitrary code.On June 12, 2018, Bosnian security researcher Jean-Yves Avenard of Mozilla discovered an ACE vulnerability in Windows 10.
On May 1, 2018, a security researcher discovered an ACE vulnerability in the 7-Zip file archiver.
PHP has been the subject of numerous ACE vulnerabilities.
On December 9, 2021, an RCE vulnerability called "Log4Shell" was discovered in popular logging framework Log4j, affecting many services including iCloud, Minecraft: Java Edition and Steam, and characterized as "the single biggest, most critical vulnerability of the last decade".