Skip to content

Command injection via RzBinInfo bclass due legacy code

High
XVilka published GHSA-5jhc-frm4-p8v9 Dec 21, 2024

Package

rizin

Affected versions

< 0.7.3

Patched versions

0.7.4

Description

Impact

rizin.c still had an old snippet of code which suffered a command injection due the usage of rz_core_cmdf to invoke the command m which was removed in v0.1.x.

A malicious binary defining bclass (part of RzBinInfo), can execute a command, if the same binary sets rclass (part of RzBinInfo) to fs; the vulnerability can be exploited by any bin format where bclass and rclass are user defined.

Patches

Fixed in via db6c5b3

References

  • rizin/librz/main/rizin.c

    Lines 1275 to 1278 in be24ca8

    if (r->bin->cur && r->bin->cur->o && r->bin->cur->o->info && r->bin->cur->o->info->rclass && !strcmp("fs", r->bin->cur->o->info->rclass)) {
    const char *fstype = r->bin->cur->o->info->bclass;
    rz_core_cmdf(r, "m /root %s @ 0", fstype);
    }

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H

CVE ID

CVE-2024-53256

Weaknesses

Credits