Vulnerability · Published Nov 8, 2021 · Assigned by GitHub_M

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

Medium 5.9

In plain English

A medium-severity heap buffer overflow in zydis from zyantific. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.9% (higher than 79% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.9Medium
Exploit odds (30 days)1.9%top 20.6% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12zydis3.2.1-1DEBIAN-CVE-2021-41253
Debian:13zydis3.2.1-1DEBIAN-CVE-2021-41253
Debian:14zydis3.2.1-1DEBIAN-CVE-2021-41253
Ubuntu:22.04:LTSzydis3.2.1-1UBUNTU-CVE-2021-41253

Affected products (as reported)

VendorProductVersions
zyantific zydis < 3.2.1

Weakness: CWE-122, CWE-457 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

References