What is remote code execution? Explained with a rewritten staff manual
Remote code execution (RCE) is a flaw that lets an attacker make your server run their own instructions over the internet. Explained with an outsider’s page slipped into an office’s staff manual.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- Engineering
This week’s security fixes for Drupal and PHP both warn about the same kind of flaw: remote code execution.
In one sentence: Remote code execution (RCE) is when a flaw in software lets an attacker, working from anywhere over the internet, make your computer or server run instructions of their own choosing, so they can do whatever that program is allowed to do, without ever touching the machine.
The everyday picture
Picture a busy office building. Visitors never go past the front desk. They hand over forms, letters and parcels, and the staff inside deal with them. The staff work from one thing only: the company’s staff manual. It tells them exactly what to do with each form.
A form is something to read and process. The manual is something to obey. Keeping those two apart is what keeps the building safe.
Now imagine a flaw at the front desk. Because of it, a page a visitor hands over ends up filed inside the staff manual. The staff don’t notice. They follow the new page as if it were company procedure, using their own keys and their own access. The visitor never walked in. That is remote code execution: an outsider’s words have become the building’s instructions.
The attacker only sends a request, but a flaw lets it become part of the code. The server then runs it with its own access to files and data.
How it works, step by step
- The attacker (the visitor) sends a request to your website or app over the internet, just like any normal user would. Sometimes they don’t even need an account.
- The request (the form) is crafted to hit a specific bug. The software is meant to treat it as data, such as a name, a file or a setting.
- The flaw (the mistake at the front desk) lets part of that data be treated as instructions. One common cause is software that builds code from outside input without cleaning it, known as code injection. Another is a memory bug, such as a buffer overflow, where data spills into places the program runs from.
- The program (the staff) runs the attacker’s instructions as if they were its own code (the staff manual).
- The attacker’s code usually gets the same access as the program it took over (the staff’s keys). On a web server, that can mean reading the database, changing the website or installing more harmful software.
Try it · What would you do?
A critical RCE fix is out. What do you do?
Your web developer forwards a security notice: the content system behind your website has a remote code execution flaw, rated critical, and a fixed version is available. You are in the middle of a busy sales week.
Pick what you would do. You can change your mind.
Where the picture stops
- Real staff might spot a strange page. Software usually can’t: it follows its instructions exactly, at machine speed, with nobody checking.
- In the picture, one page goes into one manual. In real attacks, the first small foothold is often used to bring in far more code, and sometimes to move on to other machines on the same network.
- “Remote” only means the attacker works over a network. Some flaws can only be used by someone who already has an account or access on the machine; security notices call those local, not remote.
Why it matters for your business
- It is among the most serious kinds of bug. An attacker who can run code on your server can often see or change everything that server touches, which is why security advisories rate these flaws among the highest.
- Speed counts. Drupal’s advisory, updated on 21 November, says its installer flaw was exploited on live sites from 19 November, the day after the fix came out. Patching “next quarter” is too slow for this class of bug.
- It can be designed out. MITRE’s guidance for code injection is to avoid building code from outside input at all, to “assume all input is malicious”, and to run risky code in a sandbox. CISA and the FBI urge software makers to remove memory bugs by using memory-safe programming languages.
- Least access limits the damage. If the hijacked program can only reach what it needs, the attacker inherits only that, not your whole system.
An example
Imagine a 15-person travel agency whose booking website runs on a popular content system. A security notice says the system has a remote code execution flaw and a fixed version is out. The agency’s web developer updates the site that afternoon, then checks the version number. A competitor running the same system waits for the next monthly maintenance window. In the meantime, an attacker uses the flaw to add a hidden page that copies payment details. Both businesses had the same bug. Only one closed it before it was used.
Frequently asked questions
What does RCE stand for?
RCE stands for remote code execution. It means an attacker can make a computer run code of their choosing over a network. “Arbitrary code execution” means the same thing without the “over a network” part.
Is remote code execution the same as a zero-day?
No. A zero-day describes timing: attackers use a flaw before a fix exists. RCE describes what a flaw lets attackers do. A flaw can be both, or just one of them.
How do I protect my website from remote code execution?
Install security updates quickly, especially ones rated critical, and remove software you no longer use. Give each program only the access it needs, and ask your developer or host to confirm in writing when fixes are applied.
Can antivirus software stop remote code execution?
It may catch some of the harmful files an attacker brings in afterwards, but it does not fix the flaw itself. The fix is the software update that closes the bug.
Related explainers
- What is a zero-day? Explained with a faulty door lock
- What is prompt injection? Explained with a forged note in the in-tray
- What is a sandbox? Explained with a locked workroom for a contractor
- What is a server? Explained with a kitchen that never closes
The DevDrift helps small teams keep their websites and platforms patched and hardened: see how.
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.