Skip to content

Reading list

Learn RCE from real reports

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

12 reports, easiest first.

  1. Wikimedia/svgtranslate 2.0.1 Remote Code Execution

    Wikimedia (SVGTranslate) Beginner

    The SVGTranslate application passed the user-supplied 'lang' parameter directly into a shell command without sanitisation, allowing an unauthenticated attacker to inject arbitrary commands. This could lead to full server compromise.

    The application builds a command to run a program that converts SVG images to PNG. It inserts the language code you provide directly into that command without checking it. An attacker can add extra commands after a semicolon, and the server will run them, giving the attacker control over the server.

    The lesson. The 'lang' parameter is concatenated into a shell command string without escaping or validation, allowing command injection.

  2. Exhibitor UI command injection vulnerability

    Cisco Talos Beginner

    The Exhibitor web UI's Config editor allows unauthenticated users to inject shell commands into the java.env script field, which are executed when ZooKeeper is launched. An attacker can run arbitrary commands as the user running Exhibitor.

    Exhibitor is a tool that manages ZooKeeper, a service used in distributed systems. Its web interface has a settings page where you can edit configuration, and one field is passed directly to a shell command without any filtering. This means someone can type a command like 'run this program' and it will be executed on the server, giving them control over the machine.

    The lesson. The java.env script field is passed unmodified as arguments to the Java command that launches ZooKeeper, allowing shell metacharacters to be interpreted.

  3. GHSL-2023-024: Drive-by command injection in Brook's tproxy server - CVE-2023-33965

    GitHub Security Lab Beginner

    The tproxy server's /start endpoint passes the args parameter directly to a shell command, allowing an attacker to execute arbitrary commands. An attacker could run commands on the victim's machine by tricking them into visiting a malicious page that sends a request to the local service.

    The tproxy server takes a user-supplied string and runs it as a shell command without checking it. This means an attacker can make the server run any command they want, like deleting files or installing malware. Even if the server only listens on the local machine, a malicious website can send requests to it from the victim's browser.

    The lesson. The application passes user-controlled input directly to a shell command without sanitisation or validation.

  4. [devcert] Command Injection via insecure command formatting

    Node.js third-party modules Beginner

    The devcert module builds shell commands by concatenating user-supplied domain names without sanitisation. An attacker who can control the domain argument can execute arbitrary commands on the victim's machine.

    When a program runs a system command, it must treat user input as data, not as part of the command. Here, the domain name is inserted directly into a command string, so special characters like semicolons can break out and run extra commands. This lets an attacker run their own commands on the computer running the vulnerable code.

    The lesson. The domain parameter is concatenated into a shell command string without sanitisation, allowing shell metacharacters to inject additional commands.

  5. How to get pwned with — extra-index-url

    Beginner

    The pip package manager with the --extra-index-url flag searches both a private index and PyPI, and installs the highest version found. An attacker can publish a malicious package with the same name and a higher version to PyPI, causing it to be installed instead of the intended private package.

    When you install a Python package, pip can be told to look in more than one place. If a bad person puts a package with the same name but a higher version number in the public place, pip will pick that one. This means you could end up running code from an attacker without knowing.

    The lesson. Likely, pip's dependency resolution with --extra-index-url does not prioritise the specified private index over PyPI, so it selects the highest version across all indexes.

  6. [freespace] Command Injection due to Lack of Sanitization

    Node.js third-party modules Beginner

    The freespace npm module passes a user-supplied mount point directly into a shell command without proper sanitisation, allowing an attacker to inject and execute arbitrary commands on Unix systems. This could lead to information gathering, system enumeration, and further execution of scripts or binaries.

    The library builds a command for the operating system by inserting whatever text you give it. Because it does not check for special characters like semicolons, an attacker can add extra commands that the system will run. This lets them run their own code on the server.

  7. From an Error Message to Remote Code Execution: Command Injection in a Ping Utility

    Beginner

    The ping utility endpoint concatenated user input directly into a shell command, allowing an attacker to inject arbitrary OS commands. The attacker could execute commands as the low-privilege service account and write to the application directory.

    The web app had a feature that ran the system 'ping' command to check if a host was reachable. Instead of passing the user's input safely, it glued the input onto a shell command line, so extra characters like a semicolon let an attacker run their own commands on the server.

    The lesson. Likely the server built a shell command string by concatenating the user-supplied host value directly, without sanitisation or using a safe argument-array API.

  8. [@knutkirkhorn/free-space] - Command Injection through Lack of Sanitization

    Node.js third-party modules Beginner

    The free-space npm module passes a user-supplied disk name directly into a shell command without sanitisation, allowing an attacker to execute arbitrary commands on Unix systems. This could lead to information gathering, system enumeration, and further execution of scripts or binaries.

    This package lets you check free disk space. It takes a disk name from the user and puts it into a system command without cleaning it first. Because of that, someone can add extra commands after a semicolon or double ampersand, and those commands will run on the server.

  9. Critical Vulnerabilities in PHP Everywhere Allow Remote Code Execution

    Beginner

    The PHP Everywhere WordPress plugin allowed users with low privileges, such as subscribers, to execute arbitrary PHP code via a shortcode, and contributors to execute code via a metabox or Gutenberg block. An attacker with an account could run code on the server, leading to complete site takeover.

    PHP Everywhere is a plugin that lets site owners run PHP code on their WordPress site. The plugin did not properly check who was allowed to use this feature, so even users with very limited accounts (like subscribers who can only read) could insert PHP code and have it run on the server. This let an attacker take control of the entire website.

    The lesson. The plugin failed to restrict access to its PHP execution features, allowing any user with basic permissions to supply and run arbitrary PHP code.

  10. Telegram Remote Code Execution Zero-Day Vulnerability

    Beginner

    A vulnerability in Telegram's Windows client allowed attackers to use a right-to-left override character to disguise malicious executable files as images. When a victim clicked and ran the file, attackers could install malware, including remote control tools and cryptocurrency miners.

    This report describes a trick where a special invisible character flips the order of letters in a filename. Attackers used it to make a harmful program look like a harmless picture file. When the victim opened it, their computer could be taken over or used to mine cryptocurrency.

    The lesson. Likely the Telegram Windows client did not properly handle the Unicode right-to-left override character when displaying filenames, allowing attackers to spoof file extensions.

  11. [samsung-remote] Command injection

    Node.js third-party modules Beginner

    The samsung-remote npm module passed the IP address argument straight into a shell command without sanitising it. An attacker who could influence that value could run arbitrary shell commands on the host running the module.

    This package lets a Node.js program talk to a Samsung TV, and it checks the TV is reachable by running a ping command. It builds that command by gluing the IP address onto the end of a text string, so if the address contains extra shell instructions, the computer runs them too. That means whoever controls the address can run their own commands on the server.

    The lesson. The module concatenated an untrusted IP address into a shell command string passed to child_process.exec(), so shell metacharacters in the value were interpreted as commands.

  12. [xps] Command Injection via insecure command concatenation

    Node.js third-party modules Beginner

    The xps npm module builds a shell command by concatenating the caller-supplied process id into a string passed to child_process.exec, without proper sanitisation. An attacker who can control that argument could run arbitrary commands on the machine running the code.

    This library is meant to stop a running program when you give it that program's number (its process id). Instead of passing the number safely, it glues it into a text command that the operating system then runs, so extra characters in the number can make the computer run other commands too. Anyone who can supply that value could run their own commands on the victim's machine.

    The lesson. Likely the process id is concatenated into a shell command string and run through child_process.exec, so shell metacharacters in the value are interpreted rather than treated as plain data.