Remote code execution (RCE) is when an attacker runs code of their choice on another person's system from a distance. It is also called arbitrary code execution. An RCE vulnerability is a software weakness that makes this possible, and one common cause is code injection, where an application mishandles untrusted input. Results can include exposed or changed data and disrupted services.
- Also Called2other namesRCE · arbitrary code execution
- Related Terms3linked entriesPatch management · Vulnerability management · Zero-day vulnerability
What is remote code execution?
Remote code execution (RCE) is when an attacker runs code of their choice on another person’s system from a distance. It is also called arbitrary code execution. The word “remote” means the attacker does not need to sit at the machine. The word “arbitrary” means the attacker, not the owner, picks the code.
A remote code execution vulnerability is a weakness in software that makes this possible.
How does remote code execution work?
OWASP describes code injection as the general term for attacks that inject code that is then interpreted or executed by the application. It says these attacks exploit poor handling of untrusted data, through weak input validation.
MITRE describes the same weakness in CWE-94. In its words, the product builds all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize, or incorrectly neutralizes, special elements that could modify the syntax or behavior of the intended code segment. MITRE adds that this lets attackers inject control plane data through legitimate data channels, which alters program execution.
What does a simple example look like?
This is a simple illustration, not a real case. A web application takes text from a form and passes it to a function that runs text as code. A normal user types a name. An attacker types text that is itself code, and the application runs it. OWASP shows examples of this kind, where attackers abuse functions such as eval() and include() to run injected code.
What can an attacker do with it?
OWASP says a successful code injection attack can result in loss of confidentiality, loss of integrity, loss of availability, and loss of accountability. In plain terms, data can be exposed or changed, and services can be disrupted.
How can remote code execution be reduced?
MITRE lists several mitigations for code injection. At the design stage, it suggests refactoring code to avoid generating code dynamically, running code in sandboxed environments such as chroot jails or AppArmor, and strict allowlist input validation. It notes that sandboxes contain an attack rather than prevent it. At the implementation stage, it suggests allowlists rather than relying only on blocklists, and fuzz testing and robustness testing. Fuzzing means feeding a program unexpected input to see how it behaves.
OWASP stresses proper data validation, such as checking allowed characters, data format and expected amounts of data.
CISA advises installing updates as soon as possible to protect devices against attackers who take advantage of system vulnerabilities. It also says attackers may target vulnerabilities for months or even years after updates are available.
Is remote code execution the same as code injection?
Not exactly. Code injection is a type of attack and a type of weakness. Remote code execution describes the result, where an attacker runs code on a system from afar.
Which terms are related?
Related terms include patch management, vulnerability management and zero-day vulnerability.
Also Called.
- NameRCE
- Namearbitrary code execution
Questions.
-
What is remote code execution?
Remote code execution (RCE) is when an attacker runs code of their choice on another person's system from a distance. Remote means the attacker does not need to sit at the machine, and arbitrary means the attacker picks the code.
-
How does remote code execution happen?
One route is code injection. OWASP says these attacks inject code that the application then interprets or executes, exploiting poor handling of untrusted data through weak input validation.
-
What can an attacker do with remote code execution?
OWASP says a successful code injection attack can cause loss of confidentiality, integrity, availability and accountability. In plain terms, data can be exposed or changed and services can be disrupted.
-
How can remote code execution be reduced?
MITRE suggests avoiding dynamic code generation, sandboxing and strict allowlist input validation. OWASP stresses data validation. CISA advises installing updates as soon as possible, because attackers may target vulnerabilities for months or years after updates exist.
-
Is remote code execution the same as code injection?
Not exactly. Code injection is a type of attack and a type of weakness. Remote code execution describes the result, where an attacker runs code on a system from afar.
Sources
In Our Research
- 1 F5 BIG-IP Security Vulnerability Allows Remote Code Execution: CVE-2023-46747 October 2023
- 2 Remote Code Execution Risk in jsonwebtoken (JWT) Library January 2023
- 3 NetScaler exposed edge: questions to ask your team October 2026
- 4 KEV weakness classes: which CWEs recur, 2024 to 2026 October 2026
- 5 Two NetScaler Zero-Days, One Wrong Assumption: Why Patching Does Not Close the Incident October 2026
- 6 Agentic Ransomware: What Happens When Malware Doesn’t Need a Human Operator to Decide Who to Hit Next? September 2026