Remote Code Execution (RCE)

Remote code execution (RCE) is a vulnerability that lets an attacker run their own code or commands on someone else's system over a network, often without logging in. It's among the most severe types of flaws.

IntermediateCategory: Website, application and API security

Also called: RCE, arbitrary code execution, remote command execution

What is remote code execution?

RCE means an attacker can make a system run code of their choosing from across a network. If the flaw doesn't require a login ("unauthenticated RCE"), anyone who can reach the system can take it over. That's why RCE flaws in internet-facing products usually score at or near 10 on CVSS and appear quickly in CISA's Known Exploited Vulnerabilities catalog.

How RCE flaws happen

  • Code and command injection: the app passes user input into code or system commands, as described in MITRE's CWE-94.
  • Unsafe deserialization: the app rebuilds objects from untrusted data.
  • Memory-safety bugs in software written in languages like C and C++.
  • File upload flaws that let attackers upload and run a script.
  • Other injection flaws, such as some SQL injection cases, that can be escalated to code execution.

Example: Log4Shell

In December 2021 a flaw in Log4j, a logging library used in countless Java applications, allowed RCE simply by getting the app to log a crafted text string. CISA called it one of the most serious vulnerabilities it had seen, because Log4j was buried inside so many products that organizations struggled even to find where it was used.

How to respond to an RCE announcement

  • Find out quickly whether you use the affected product, including inside other software.
  • Patch or apply the vendor's mitigation immediately for anything internet-facing.
  • If you can't patch, restrict access or take the system offline.
  • Check for signs of compromise, since exploitation often starts before patches are applied.

Related terms

Sources

  1. Apache Log4j Vulnerability Guidance (CISA)
  2. CWE-94: Improper Control of Generation of Code ('Code Injection') (MITRE CWE)

Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.