# Remote Code Execution (RCE)

> Someone far off makes your machine run their code.

**Field:** Software Development  
**Category:** Security  
**Also known as:** RCE, Arbitrary Code Execution

## Think of it like

Think of it like a stranger far off who can move your hands.

## Definition

Remote code execution is when an attacker can run their own code on someone else's computer from far away. It is the worst kind of security hole. Injection, unsafe file uploads and rebuilding bad data can all lead to it. Once the code runs, it has the same rights as the app it broke into. That is why apps should run with as few rights as they can.

## Example

A flaw in a photo app lets a booby-trapped picture run code. Opening one bad picture lets an attacker control the phone.

## Why it matters

With RCE an attacker can do anything the app can do. Holes like this are always fixed first.

## Common mistake

Running the app as an admin user. Then any RCE gives the attacker full control of the whole server.

## Three principles

- **Their code, your machine.** Run from far away.
- **Many roads in.** Injection, uploads and bad data.
- **Limit the damage.** Run apps with few rights.

## Related terms

- [Command Injection](https://learn.benibix.com/term/development/command-injection)
- [Exploit (Security)](https://learn.benibix.com/term/development/exploit)
- [Security Vulnerability](https://learn.benibix.com/term/development/vulnerability)
- [Serialization](https://learn.benibix.com/term/development/serialization)
- [Principle of Least Privilege](https://learn.benibix.com/term/development/principle-of-least-privilege)
- [Malware](https://learn.benibix.com/term/infrastructure/malware)

![A table of four attacks, with what the attacker sends and what goes wrong. SSRF sends preview?url=http://10.0.0.5/admin, and the server fetches its own private page. Path traversal sends view?file=../../../etc/passwd, and a server file is sent back. Broken access control asks for /orders/1042, not his own, and a stranger's order is shown. Remote code execution, lit up, sends a booby-trapped upload or request, and the attacker's code runs on the server.](https://learn.benibix.com/diagrams/dev2-server-attacks.svg)

---

Source: https://learn.benibix.com/term/development/remote-code-execution
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
