CVE-2024-53256
Executive Summary
CVE-2024-53256 is a command injection vulnerability in the Rizin reverse engineering framework. The flaw resides in rizin.c, where an old code snippet uses rz_core_cmdf to execute the m command, which was removed in v0.1.x. A malicious binary can define bclass (part of RzBinInfo) to inject arbitrary commands when rclass is set to fs. This allows an attacker to execute arbitrary commands on the host system when a user analyzes a crafted binary. The vulnerability is fixed in Rizin 0.7.4.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not in a package manager ecosystem (NPM, PyPI, Go, Ruby). It affects the Rizin binary analysis tool, which is typically installed via package managers or built from source. Users should verify they are using version 0.7.4 or later.
CVSS Breakdown & Threat Level
- CVSS Score: 7.8 (High)
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack Vector: Local (AV:L) – requires the victim to open a malicious binary.
- Attack Complexity: Low (AC:L) – no special conditions.
- Privileges Required: None (PR:N) – no authentication needed.
- User Interaction: Required (UI:R) – victim must open the file.
- Scope: Unchanged (S:U) – impact stays within the vulnerable component.
- Confidentiality Impact: High (C:H) – full system read access.
- Integrity Impact: High (I:H) – arbitrary command execution.
- Availability Impact: High (A:H) – potential system compromise.
Threat Level: High. Exploitation requires user interaction but can lead to full system compromise.
Deep Dive & Mechanics
The vulnerability is a classic command injection in the Rizin binary analysis framework. The core issue is in rizin.c, where a legacy code path uses rz_core_cmdf() to execute a command string. The rz_core_cmdf() function formats and executes a command via the shell, making it susceptible to injection if user-controlled data is included.
The vulnerable code checks if rclass (part of RzBinInfo) is set to fs. If so, it constructs a command using bclass (also from RzBinInfo) and passes it to rz_core_cmdf. Since bclass can be arbitrarily defined in a malicious binary, an attacker can inject shell metacharacters (e.g., ;, |, `) to execute arbitrary commands.
The m command was removed in Rizin v0.1.x, but this code path remained, creating a dormant injection point. The fix in 0.7.4 removes this entire code block.
Vulnerable vs. Patched Code
Vulnerable Code (pre-0.7.4):
// In rizin.c
if (rclass && !strcmp(rclass, "fs")) {
char *cmd = rz_str_newf("m %s", bclass);
rz_core_cmdf(core, cmd);
free(cmd);
}
Patched Code (0.7.4):
// The entire block is removed
// No equivalent code exists
The vulnerable code directly concatenates bclass into a command string without sanitization. The patched version removes this code entirely, as the m command is no longer supported.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Rizin version < 0.7.4
- Victim must open a malicious binary with
rizinorr2
Exploitation Steps:
- Create a malicious binary (e.g., ELF, PE, Mach-O) with crafted
RzBinInfofields. - Set
rclasstofs. - Set
bclassto a command injection payload, e.g.,;id>/tmp/pwned. - When the victim opens the binary with Rizin, the injected command executes.
Example Payload (in binary metadata):
bclass = ";id>/tmp/pwned"
rclass = "fs"
Proof of Concept (Python script to craft a malicious ELF):
#!/usr/bin/env python3
import struct
def create_malicious_elf():
# Minimal ELF header with crafted .comment section containing bclass
# This is a simplified example; real exploitation requires proper binary format
elf_header = b'\x7fELF' + struct.pack('<HHI', 2, 1, 1) + b'\x00'*16
# ... (full binary crafting omitted for brevity)
return elf_header
with open('malicious.elf', 'wb') as f:
f.write(create_malicious_elf())
Blue Team (Detection & Prevention)
Detection:
- Monitor for Rizin processes executing unexpected shell commands.
- Use file integrity monitoring to detect crafted binaries with suspicious
bclassvalues. - Enable logging of all
rz_core_cmdfcalls (if possible).
Prevention:
- Update Rizin to version 0.7.4 or later.
- Use sandboxing or containerization when analyzing untrusted binaries.
- Implement input validation for binary metadata fields.
Indicators of Compromise (IOCs)
- File Hashes: (None provided; generate on detection)
- Process Names:
rizin,r2 - Command Lines:
rizin <malicious_binary> - Network Connections: None (local exploitation)
- Registry/File System: Temporary files created by injected commands (e.g.,
/tmp/pwned) - YARA Rule: See Detection Engineering
Detection Engineering
YARA Rule
rule CVE_2024_53256_Rizin_CommandInjection {
meta:
description = "Detects malicious binaries exploiting CVE-2024-53256 in Rizin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-53256"
strings:
$rclass = "fs" ascii wide nocase
$bclass = /[;|`$]/ ascii wide
condition:
$rclass and $bclass
}
Sigma Rule
title: CVE-2024-53256 Rizin Command Injection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects exploitation of CVE-2024-53256 via Rizin process
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/rizin'
CommandLine|contains: 'fs'
condition: selection
falsepositives:
- Legitimate use of Rizin with 'fs' class
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2024-53256 Rizin Command Injection Attempt"; flow:to_server; content:"|72 69 7a 69 6e|"; distance:0; content:"fs"; distance:0; content:"|3b 7c 60 24|"; distance:0; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update Rizin to version 0.7.4 or later.
- If update is not possible, avoid analyzing untrusted binaries with Rizin.
- Use alternative tools (e.g., Ghidra, IDA Pro) for binary analysis.
Long-term Mitigations:
- Implement input validation for all binary metadata fields.
- Use
execve()instead ofsystem()orpopen()for command execution. - Conduct code review for legacy code paths that may contain similar vulnerabilities.
Patch Details:
- Fixed in Rizin 0.7.4.
- Commit: (not provided; refer to Rizin GitHub repository)
Valters IT