CVE-2021-41253Possible heap buffer overflow when using zycore string functions in formatter hooks
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.
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | zydis | Not affected vulnerable_code_not_present | ||
| Debian 14 | zydis | Fixed | 3.2.1-1 | DEBIAN-CVE-2021-41253 |
| Debian 13 | zydis | Fixed | 3.2.1-1 | DEBIAN-CVE-2021-41253 |
| Debian 12 | zydis | Fixed | 3.2.1-1 | DEBIAN-CVE-2021-41253 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- zyantific zydis: affected: < 3.2.1
References
- https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g
- https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5
- https://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a
- https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.