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

- Severity: High 7.6 (CVSS:3.0, scored by @huntrdev) `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.73%, higher than 55% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-04-06T10:15:15.000Z
- Modified: 2026-06-17T04:22:04.463Z
- Weaknesses: CWE-122, CWE-787
- Assigned by: @huntrdev

## 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).

(As written by CVE List.)

## Affected

- radareorg radareorg/radare2: from unspecified before 5.8.6
- radare radare2: up to 5.6.6

## Every score

- @huntrdev: CVSS:3.0 7.6 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.8 Medium `AV:N/AC:M/Au:N/C:P/I:P/A:P`

## References

- <https://huntr.dev/bounties/e589bd97-4c74-4e79-93b5-0951a281facc> (exploit, issue-tracking, patch, third-party-advisory)
- <https://github.com/radareorg/radare2/commit/ca8d8b39f3e34a4fd943270330b80f1148129de4> (patch, third-party-advisory)

## Sources

- CVE List: [CVE-2022-1240](https://www.cve.org/CVERecord?id=CVE-2022-1240), CVE Terms of Use, modified 2024-08-02
- NVD: [CVE-2022-1240](https://nvd.nist.gov/vuln/detail/CVE-2022-1240), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-1240 · Whole record: https://cve.day/CVE-2022-1240.json · Rebuilt by cve.day 2026-11-25T22:58:10.448Z
