# CVE-2021-41253: Possible heap buffer overflow when using zycore string functions in formatter hooks

- Severity: Medium 5.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/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): 1.86%, higher than 79% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-11-08T21:45:11.000Z
- Modified: 2026-06-17T04:08:10.943Z
- Weaknesses: CWE-122, CWE-457, CWE-908
- Assigned by: GitHub_M

## Description

Zydis is an x86/x86-64 disassembler library. Users of Zydis versions v3.2.0 and older that use the string functions provided in `zycore` in order to append untrusted user data to the formatter buffer within their custom formatter hooks can run into heap buffer overflows. Older versions of Zydis failed to properly initialize the string object within the formatter buffer, forgetting to initialize a few fields, leaving their value to chance. This could then in turn cause zycore functions like `ZyanStringAppend` to make incorrect calculations for the new target size, resulting in heap memory corruption. This does not affect the regular uncustomized Zydis formatter, because Zydis internally doesn't use the string functions in zycore that act upon these fields. However, because the zycore string functions are the intended way to work with the formatter buffer for users of the library that wish to extend the formatter, we still consider this to be a vulnerability in Zydis. This bug is patched starting in version 3.2.1. As a workaround, users may refrain from using zycore string functions in their formatter hooks until updating to a patched version.

(As written by CVE List.)

## Affected

- zyantific zydis: < 3.2.1; up to 3.2.0

## Every score

- GitHub_M: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/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/96b0a482-7041-45b1-9327-c6a4a8f32d3a> (exploit, third-party-advisory)
- <https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784> (exploit, patch, third-party-advisory)
- <https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g> (third-party-advisory)
- <https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5> (patch, third-party-advisory)

## Sources

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

---

Page: https://cve.day/CVE-2021-41253 · Whole record: https://cve.day/CVE-2021-41253.json · Rebuilt by cve.day 2026-11-25T22:58:05.432Z
