Arbitrary code execution

From HandWiki
Short description: Cyber attack where any code can be run

In computer security, arbitrary code execution (ACE) 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.[1] 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 (especially via a wide-area network such as the Internet) is often referred to as remote code execution (RCE).

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.[2]

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:

Methods

Arbitrary code execution is commonly achieved through control over the instruction pointer (such as a jump or a branch) of a running process. The instruction pointer points to the next instruction in the process that will be executed. Control over the value of the instruction pointer therefore gives control over which instruction is executed next. In order to execute arbitrary code, many exploits inject code into the process (for example by sending input to it which gets stored in an input buffer in RAM) and use a vulnerability to change the instruction pointer to have it point to the injected code. The injected code will then automatically get executed. This type of attack exploits the fact that most computers (which use a Von Neumann architecture) do not make a general distinction between code and data,[7][8] so that malicious code can be camouflaged as harmless input data. Many newer CPUs have mechanisms to make this harder, such as a no-execute bit.[9][10]

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.[11] 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 (unless the user in question also had that access).

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

Retrogaming 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 speedrunning enthusiasts managed to code and run versions of the games Pong and Snake in a copy of Super Mario World[12] by utilizing a buffer overflow to write arbitrary code to memory.

On June 12, 2018, Bosnian security researcher Jean-Yves Avenard of Mozilla discovered an ACE vulnerability in Windows 10.[13]

On May 1, 2018, a security researcher discovered an ACE vulnerability in the 7-Zip file archiver.[14]

PHP has been the subject of numerous ACE vulnerabilities.[15][16][17]

On December 9, 2021, a 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".[18][19]

See also

References

  1. Team, KernelCare (25 January 2021). "Remote code execution attack: what it is, how to protect your systems" (in en). https://blog.kernelcare.com/vulnerability/remote-code-execution-attack-what-it-is-and-how-to-protect-your-systems. 
  2. Johnson, Pontus (2021). Intrinsic Propensity for Vulnerability in Computers? Arbitrary Code Execution in the Universal Turing Machine. 
  3. "Deserialization of untrusted data". https://www.owasp.org/index.php/Deserialization_of_untrusted_data. 
  4. "Understanding type confusion vulnerabilities: CVE-2015-0336". 18 June 2015. https://www.microsoft.com/security/blog/2015/06/17/understanding-type-confusion-vulnerabilities-cve-2015-0336/. 
  5. "Exploiting CVE-2018-19134: remote code execution through type confusion in Ghostscript". 5 February 2019. https://lgtm.com/blog/ghostscript_CVE-2018-19134_exploit. 
  6. "LDD arbitrary code execution". https://catonmat.net/ldd-arbitrary-code-execution. 
  7. Gilreath, William F.; Laplante, Phillip A. (2003-03-31) (in en). Computer Architecture: A Minimalist Perspective. Springer Science & Business Media. ISBN 9781402074165. https://books.google.com/books?id=9DuC35atMu0C&pg=RA1-PA24. 
  8. Reilly, Edwin D. (2003) (in en). Milestones in Computer Science and Information Technology. Greenwood Publishing Group. p. 245. ISBN 9781573565219. https://archive.org/details/milestonesincomp0000reil. 
  9. "Tech Insight: Execute Disable Bit (XD-Bit)". 2005. http://www.toshiba.pl/Contents/Toshiba_teg/EU/Others/EasyGuard/tech_insights/Tech-Insight-XD-BIT-EN.pdf. 
  10. "AMD has you covered.". 2012. https://www.amd.com/Documents/Security_021.pdf#page=2. 
  11. "Remote Code Execution - an overview". https://www.sciencedirect.com/topics/computer-science/remote-code-execution. 
  12. Orland, Kyle (14 January 2014). "How an emulator-fueled robot reprogrammed Super Mario World on the fly". https://arstechnica.com/gaming/2014/01/how-an-emulator-fueled-robot-reprogrammed-super-mario-world-on-the-fly/. 
  13. "Microsoft Windows CVE-2018-8213 Arbitrary Code Execution Vulnerability" (in en). https://www.symantec.com/security-center/vulnerabilities/writeup/104406. 
  14. "A Vulnerability in 7-Zip Could Allow for Arbitrary Code Execution" (in en-US). https://its.ny.gov/security-advisory/vulnerability-7-zip-could-allow. 
  15. "NVD - CVE-2017-12934". https://nvd.nist.gov/vuln/detail/CVE-2017-12934. 
  16. "File Operation Induced Unserialization via the "phar://" Stream Wrapper". 2018. https://cdn2.hubspot.net/hubfs/3853213/us-18-Thomas-It's-A-PHP-Unserialization-Vulnerability-Jim-But-Not-As-We-....pdf?. 
  17. "NVD - CVE-2017-12933". https://nvd.nist.gov/vuln/detail/CVE-2017-12933. 
  18. "Zeroday in ubiquitous Log4j tool poses a grave threat to the Internet". December 9, 2021. https://arstechnica.com/information-technology/2021/12/minecraft-and-other-apps-face-serious-threat-from-new-code-execution-bug/. 
  19. "Recently uncovered software flaw 'most critical vulnerability of the last decade'". 11 December 2021. https://www.theguardian.com/technology/2021/dec/10/software-flaw-most-critical-vulnerability-log-4-shell.