Vulnerability · Published Apr 6, 2022 · Assigned by @huntrdev

CVE-2022-1240Heap buffer overflow in libr/bin/format/mach0/mach0.c in radareorg/radare2

High 7.6

In plain English

A high-severity heap buffer overflow in radareorg/radare2 from radareorg. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 55% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.0)7.6High
Exploit odds (30 days)0.7%top 45.3% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official description

Heap buffer overflow in libr/bin/format/mach0/mach0.c in GitHub repository radareorg/radare2 prior to 5.8.6. If address sanitizer is disabled during the compiling, the program should executes into the `r_str_ncpy` function. Therefore I think it is very likely to be exploitable. For more general description of heap buffer overflow, see [CWE](https://cwe.mitre.org/data/definitions/122.html).

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.20radare25.6.6-r0ALPINE-CVE-2022-1240
Alpine:v3.21radare25.6.6-r0ALPINE-CVE-2022-1240
Alpine:v3.22radare25.6.6-r0ALPINE-CVE-2022-1240
Alpine:v3.23radare25.6.6-r0ALPINE-CVE-2022-1240
Alpine:v3.24radare25.6.6-r0ALPINE-CVE-2022-1240
Ubuntu:25.10radare2no fix listedUBUNTU-CVE-2022-1240
Ubuntu:26.04:LTSradare2no fix listedUBUNTU-CVE-2022-1240
Ubuntu:26.10radare2no fix listedUBUNTU-CVE-2022-1240

Affected products (as reported)

VendorProductVersions
radareorg radareorg/radare2 unspecified – before 5.8.6

Weakness: CWE-122 · Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H

References