The Novee Gym is open for business at Black Hat Europe

Book a meeting

The Novee Gym is open for business at Black Hat Europe

Book a meeting

Glossary › Remote Code Execution

Remote Code Execution

Explore Article +

Key Takeaways

  • Remote code execution (RCE) lets an attacker run arbitrary code on a system they reach over a network.
  • It usually stems from injection, a deserialization vulnerability, memory corruption or unsafe file handling.
  • A working RCE exploit gives the attacker the application’s privileges and a foothold for lateral movement.
  • Patching, sandboxing, safe input handling and least privilege together shrink RCE exposure.

What Is Remote Code Execution?

Remote code execution is the ability of an attacker to run code of their choosing on a target machine over a network, without physical or prior local access. It is the remote form of arbitrary code execution and is usually the most severe outcome a vulnerability can have.

RCE is an impact, not a single bug. Many flaw types lead to it, and once achieved, the attacker effectively controls the vulnerable process.

The Vulnerability Classes That Most Often Lead to RCE

  • Injection. Command injection passes input to a shell, and code injection reaches functions like eval(). Server-side template injection belongs here too.
  • Deserialization vulnerability. Insecure deserialization lets crafted objects trigger gadget chains that execute code, as in Java and .NET apps.
  • Memory corruption. Buffer overflows, use-after-free and type confusion bugs in C and C++ code let attackers hijack execution flow.
  • Unsafe file handling. Unrestricted uploads of scripts, and local file inclusion that executes attacker-controlled content.
  • Unsafe lookups and features. Log4Shell (CVE-2021-44228) abused JNDI lookups in log messages to load remote Java classes.

What a Server Is Exposed to Once RCE Is Confirmed

Code runs with the privileges of the exploited process, often a web server or service account. From there, attackers typically:

  • Harvest secrets. Read environment variables, configuration files, cloud metadata endpoints and credential stores.
  • Establish persistence. Drop web shells, reverse shells, new users or scheduled tasks.
  • Escalate privileges. Exploit local flaws or misconfigurations to reach root or SYSTEM.
  • Move laterally. Pivot to internal databases, CI/CD systems and identity infrastructure.
  • Monetize access. Deploy ransomware, exfiltrate data or run cryptominers.

How RCE Exploitability Is Confirmed During a Pentest

Pentesters prove execution with the least damaging evidence possible. Common methods are running id or whoami and capturing the output, timing a sleep command, or triggering a DNS or HTTP callback to a tester-controlled server when output is hidden.

The proof of concept (PoC) documents the exact request, the execution evidence, the privileges gained and the realistic blast radius. It avoids destructive actions and is agreed in the rules of engagement.

Confirming exploitability, not just flagging a vulnerable version, is what separates validated findings from noise. Gartner’s push toward continuous offensive security testing reflects that shift, and Novee’s team explains the approach in this AI penetration testing interview. Novee’s agents chain findings to show real impact, three independent agents validate each one, and Agentic Remediation retests to confirm fixes hold.

What Reduces RCE Exposure at the Architecture and Code Level

  • Patch fast. Prioritize internet-facing systems and known exploited vulnerabilities, and track dependencies with software composition analysis.
  • Handle input safely. Avoid shells and eval(), use safe serialization formats like JSON with strict schemas and validate uploads.
  • Use memory-safe languages. Rust, Go, Java and C# remove whole classes of memory corruption bugs.
  • Sandbox and isolate. Run services in containers with seccomp profiles and read-only file systems, and segment networks.
  • Apply least privilege. Run processes as non-root accounts and enable compiler and OS mitigations such as ASLR and DEP.

FAQ

Remote code execution is triggered over a network, so the attacker needs no prior access to the machine. Local code execution requires an existing foothold, such as a user account or the ability to run a file on the system. RCE is the initial entry point; local execution often follows it for privilege escalation.

Yes. Many RCE flaws in network services need only a crafted request, with no clicks from users. These zero-click or wormable bugs are the most dangerous. EternalBlue, the SMBv1 flaw (MS17-010) behind WannaCry in 2017, spread between machines automatically. Client-side RCE in browsers or documents usually requires a user to open content.

Unauthenticated, network-reachable RCE with low attack complexity typically scores 9.8 or 10.0, Critical, under CVSS v3.1. Log4Shell scored 10.0. Scores drop when exploitation requires authentication, user interaction or local network access, but RCE rarely falls below High because of its impact on confidentiality, integrity and availability.

The 2017 Equifax breach began with Apache Struts RCE CVE-2017-5638, exposing data on about 147 million people. WannaCry used EternalBlue RCE the same year. Log4Shell triggered global exploitation in December 2021, and the 2023 MOVEit Transfer campaign chained SQL injection to RCE to steal data from thousands of organizations.

No. Some RCE flaws need specific configurations, authentication or reliable bypasses for mitigations like ASLR and DEP before a working exploit exists. Others are exploited within days, especially once a public proof of concept appears. Teams should treat any confirmed RCE as urgent rather than wait for exploitation evidence.