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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | radare2 | 5.6.6-r0 | ALPINE-CVE-2022-1240 |
| Alpine:v3.21 | radare2 | 5.6.6-r0 | ALPINE-CVE-2022-1240 |
| Alpine:v3.22 | radare2 | 5.6.6-r0 | ALPINE-CVE-2022-1240 |
| Alpine:v3.23 | radare2 | 5.6.6-r0 | ALPINE-CVE-2022-1240 |
| Alpine:v3.24 | radare2 | 5.6.6-r0 | ALPINE-CVE-2022-1240 |
| Ubuntu:25.10 | radare2 | no fix listed | UBUNTU-CVE-2022-1240 |
| Ubuntu:26.04:LTS | radare2 | no fix listed | UBUNTU-CVE-2022-1240 |
| Ubuntu:26.10 | radare2 | no fix listed | UBUNTU-CVE-2022-1240 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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
- https://huntr.dev/bounties/e589bd97-4c74-4e79-93b5-0951a281facc x_refsource_CONFIRM
- https://github.com/radareorg/radare2/commit/ca8d8b39f3e34a4fd943270330b80f1148129de4 x_refsource_MISC