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

- Priority: **Prioritise**
- Reason: Public exploit (reference, Date unknown)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2022-04-06 · Modified: 2024-08-02
- Aliases: UBUNTU-CVE-2022-1240, ALPINE-CVE-2022-1240
- Record: https://cvemate.com/vulnerability/CVE-2022-1240 · JSON: https://cvemate.com/vulnerability/CVE-2022-1240/json

## Description

```text
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).
```

## Signals

- CVSS: 7.8 high (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 0.733%, percentile 55.747%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (reference)

## Affected

- alpine radare2 (Alpine Linux): \< 5.6.6-r0
- ubuntu radare2 (Ubuntu): All versions (No fix recorded)
- radare radare2: ≤ 5.6.6
- radareorg radareorg/radare2: ≥ unspecified, \< 5.8.6

## References

- <https://huntr.dev/bounties/e589bd97-4c74-4e79-93b5-0951a281facc>
- <https://github.com/radareorg/radare2/commit/ca8d8b39f3e34a4fd943270330b80f1148129de4>
- <https://ubuntu.com/security/CVE-2022-1240>
- <https://www.cve.org/CVERecord?id=CVE-2022-1240>
- <https://security.alpinelinux.org/vuln/CVE-2022-1240>

---

Data as of 2026-12-05T12:34:32.755Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
