Arbitrary code execution

From Wikipedia, the free encyclopedia

In computer security, arbitrary code execution (ACE) is an attacker's ability to execute arbitrary commands or code 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 (especially via a wide-area network such as the Internet) is often referred to as remote code execution (RCE).

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,[5][6] 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.[7][8]

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.[citation needed] 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 order 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[9] by utilizing a buffer overflow to write arbitrary code to memory.

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

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

PHP has been the subject of numerous ACE vulnerabilities.[12][13][14]

On July 14, 2020 a mobile app security company Oversecured reported about an ACE in the Google Play Core library that lead to execution of arbitrary code in multiple Android apps including Google Chrome.[15]

See also[]

  • BlueKeep (security vulnerability)

References[]

  1. ^ "Deserialization of untrusted data". owasp.org.
  2. ^ "Understanding type confusion vulnerabilities: CVE-2015-0336". microsoft.com.
  3. ^ "Exploiting CVE-2018-19134: remote code execution through type confusion in Ghostscript". lgtm.com.
  4. ^ https://catonmat.net/ldd-arbitrary-code-execution
  5. ^ Gilreath, William F.; Laplante, Phillip A. (2003-03-31). Computer Architecture: A Minimalist Perspective. Springer Science & Business Media. ISBN 9781402074165.
  6. ^ Reilly, Edwin D. (2003). Milestones in Computer Science and Information Technology. Greenwood Publishing Group. p. 245. ISBN 9781573565219.
  7. ^ "Tech Insight: Execute Disable Bit (XD-Bit)" (PDF). toshiba.pl. 2005.
  8. ^ "AMD has you covered" (PDF). amd.com. 2012.
  9. ^ Orland, Kyle (14 January 2014). "How an emulator-fueled robot reprogrammed Super Mario World on the fly". arstechnica.com. Retrieved 27 July 2016.
  10. ^ "Microsoft Windows CVE-2018-8213 Arbitrary Code Execution Vulnerability | Symantec". www.symantec.com. Retrieved 2018-10-31.
  11. ^ "A Vulnerability in 7-Zip Could Allow for Arbitrary Code Execution". New York State Office of Information Technology Services. Retrieved 2018-10-31.
  12. ^ "NVD - CVE-2017-12934". nvd.nist.gov. Retrieved 2018-10-31.
  13. ^ "File Operation Induced Unserialization via the "phar://" Stream Wrapper" (PDF). Secarma Labs. 2018.
  14. ^ "NVD - CVE-2017-12933". nvd.nist.gov. Retrieved 2018-10-31.
  15. ^ "Android: arbitrary code execution via third-party package contexts". News, Techniques & Guides. Retrieved 2021-01-27.
Retrieved from ""