Summary
A command injection vulnerability in radare2 affects the rabin2 -PP functionality when radare2 is built on UNIX systems without SSL support.
By supplying a crafted PDB name, an attacker can cause rabin2 to execute unintended operating system commands in the context of the user running the tool.
Affected context
This vulnerability occurs specifically in radare2 builds on UNIX-like systems that are configured without SSL support and that include the affected snapshot between versions 6.1.2 and 6.1.3.
It is triggered when rabin2 is invoked with the -PP option and processes a PDB name that is treated unsafely by downstream command execution logic.
The risk is most relevant in workflows or scripts where the PDB name can be influenced by untrusted or semi-trusted input, or where automation passes externally supplied file identifiers directly to rabin2 -PP.
Exploit preconditions
- Attack surface: Local execution of
rabin2with the-PPoption on a vulnerable radare2 build (UNIX without SSL). - Required access: Ability to supply or control the PDB name value processed by
rabin2 -PP(e.g., via command-line arguments, scripts, or tooling integrations). - Trigger point: Invocation of
rabin2 -PP <PDB-name>where the PDB name is embedded into an OS command without proper sanitization or escaping. - Why exploitation is possible: The PDB name is incorporated into command construction or passed to a shell in a way that allows shell metacharacters or command separators to be interpreted, enabling injection of arbitrary commands.
Why this happens
The root cause is improper handling of externally influenced data used to build or invoke operating system commands, aligning with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
In the vulnerable code path, the PDB name argument given to rabin2 -PP is treated as trusted and is either concatenated into a command string or passed through APIs that ultimately invoke a shell without adequate quoting, escaping, or validation.
This insecure pattern allows user-controlled characters such as ;, |, &, backticks, or other shell syntax to break out of the intended context, causing additional commands to be executed.
Potential impact
- Execution of arbitrary OS commands with the privileges of the user running
rabin2. - Compromise of the local development or analysis environment where radare2 is used.
- Exfiltration, modification, or deletion of files accessible to the affected user account.
- Use of the compromised environment as a foothold for further lateral movement, depending on existing trust relationships and credentials.
General mitigation guidance
Effective mitigation focuses on controlling how external input is incorporated into command execution and minimizing reliance on shell parsing:
- Refactor code paths to avoid constructing shell command strings from user-controlled values; instead, use APIs that pass arguments as arrays/buffers without invoking a shell.
- Apply strict input validation for PDB names and similar parameters, rejecting unexpected characters (such as shell metacharacters) and enforcing well-formed file name patterns.
- Normalize and sanitize any file-like input before use, ensuring it is treated strictly as data, not as a fragment of executable syntax.
- Run radare2 and related tooling under least-privilege accounts, so that even if command injection occurs, the impact is constrained.
- Where possible, separate analysis workflows so that tools processing externally supplied artifacts are isolated (for example, via containers, sandboxes, or restricted environments).
How teams detect issues like this
Detecting and preventing similar issues typically involves a mix of static checks, review practices, and runtime safeguards:
- Configure static analysis or linters to flag uses of APIs that execute shell commands (e.g.,
system,popen,exec*variants) when arguments include unsanitized or concatenated user-controlled strings. - During code reviews, scrutinize any logic that forms command strings or passes user input to system utilities; look for direct string interpolation, concatenation, or lack of validation and escaping.
- Enforce secure coding guidelines and policies requiring argument-based process execution (e.g.,
execve/posix_spawnwith argument arrays) instead of shell-based helpers whenever user input is involved. - Integrate automated tooling into CI pipelines to search for command execution patterns and to enforce centrally defined security rules for input handling.
- Optionally perform targeted dynamic testing by fuzzing command-line parameters and file names to uncover unexpected behavior in command invocation paths.

