CVE-2021-41253

Source
https://nvd.nist.gov/vuln/detail/CVE-2021-41253
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-41253.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-41253
Downstream
Related
  • GHSA-q42v-hv86-3m4g
Published
2021-11-08T22:15:16.757Z
Modified
2025-11-20T11:07:33.788260Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
[none]
Details

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.

References

Affected packages

Git / github.com/zyantific/zydis

Affected ranges

Type
GIT
Repo
https://github.com/zyantific/zydis
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

v1.*

v1.0.0
v1.0.1

v2.*

v2.0.0
v2.0.0-alpha1
v2.0.0-alpha2
v2.0.0-beta1
v2.0.1
v2.0.2

v3.*

v3.0.0
v3.1.0
v3.2.0

Database specific

vanir_signatures

[
    {
        "target": {
            "file": "src/Formatter.c"
        },
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "95202623077736355348467005369426083389",
                "288421806461764662569100690720474703129",
                "251201009524686085471266588600378095801",
                "190130015637827485716574634459656775964",
                "75434954162241718897081605033538206746",
                "277810875866486662770443819419876137802",
                "200586352500129976049931087324566451234",
                "305748130765462596968339795348106924571",
                "94172111007509345927349911819440003180",
                "53420406301599473790506749669424388016",
                "314888051751372529043176079083334739101",
                "188975410142606827868756130992592416920",
                "204719839137841502853036700526584324055",
                "323370678802058934318034487399605864368",
                "130579442064081834602153741937167958152",
                "75434954162241718897081605033538206746",
                "277810875866486662770443819419876137802",
                "200586352500129976049931087324566451234",
                "269268971747311383201305432857466093672",
                "207320639722020763534754574993597551162",
                "169804866269125084039259179960780928172"
            ],
            "threshold": 0.9
        },
        "source": "https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5",
        "deprecated": false,
        "id": "CVE-2021-41253-1960e8c4",
        "signature_type": "Line"
    },
    {
        "target": {
            "function": "ZydisFormatterBufferInit",
            "file": "src/Formatter.c"
        },
        "signature_version": "v1",
        "digest": {
            "length": 481.0,
            "function_hash": "85656840349652340385409870582561891705"
        },
        "source": "https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5",
        "deprecated": false,
        "id": "CVE-2021-41253-8f49bd7d",
        "signature_type": "Function"
    },
    {
        "target": {
            "function": "ZydisFormatterBufferInitTokenized",
            "file": "src/Formatter.c"
        },
        "signature_version": "v1",
        "digest": {
            "length": 722.0,
            "function_hash": "49598799014068560597880790597120751311"
        },
        "source": "https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5",
        "deprecated": false,
        "id": "CVE-2021-41253-a09267df",
        "signature_type": "Function"
    }
]