Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-41253

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-41253
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 13:03 UTC · Revision 1

Source evidence

CVE-2021-41253

core-osv · Original source

Published 8 Nov 2021, 22:15 UTC

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.

osv:CVE-2021-41253
Complete source record
{
  "id": "9469e5d18b2a67f5abf496542bb05078170155453fff2892ab26222e8fb44214",
  "url": "https://osv.dev/vulnerability/CVE-2021-41253",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-41253",
    "summary": "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.",
    "evidence": "osv:CVE-2021-41253",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-41253",
      "aliases": [
        "CVE-2021-41253",
        "GHSA-q42v-hv86-3m4g"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/zyantific/zydis",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "746faa454c33c09e897504cc56b16d47d6fe89d5"
                },
                {
                  "fixed": "55dd08c210722aed81b38132f5fd4a04ec1943b5"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:zyantific:zydis:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "3.2.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "55dd08c210722aed81b38132f5fd4a04ec1943b5"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.2.0",
            "v3.1.0",
            "v3.0.0",
            "v2.0.0",
            "v2.0.0-beta1",
            "v2.0.0-alpha2",
            "v2.0.0-alpha1",
            "v1.0.1",
            "v1.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-41253.json",
            "vanir_signatures": [
              {
                "id": "CVE-2021-41253-1960e8c4",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "95202623077736355348467005369426083389",
                    "288421806461764662569100690720474703129",
                    "251201009524686085471266588600378095801",
                    "190130015637827485716574634459656775964",
                    "75434954162241718897081605033538206746",
                    "277810875866486662770443819419876137802",
                    "200586352500129976049931087324566451234",
                    "305748130765462596968339795348106924571",
                    "94172111007509345927349911819440003180",
                    "53420406301599473790506749669424388016",
                    "314888051751372529043176079083334739101",
                    "188975410142606827868756130992592416920",
                    "204719839137841502853036700526584324055",
                    "323370678802058934318034487399605864368",
                    "130579442064081834602153741937167958152",
                    "75434954162241718897081605033538206746",
                    "277810875866486662770443819419876137802",
                    "200586352500129976049931087324566451234",
                    "269268971747311383201305432857466093672",
                    "207320639722020763534754574993597551162",
                    "169804866269125084039259179960780928172"
                  ]
                },
                "source": "https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5",
                "target": {
                  "file": "src/Formatter.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-41253-8f49bd7d",
                "digest": {
                  "length": 481,
                  "function_hash": "85656840349652340385409870582561891705"
                },
                "source": "https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5",
                "target": {
                  "file": "src/Formatter.c",
                  "function": "ZydisFormatterBufferInit"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-41253-a09267df",
                "digest": {
                  "length": 722,
                  "function_hash": "49598799014068560597880790597120751311"
                },
                "source": "https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5",
                "target": {
                  "file": "src/Formatter.c",
                  "function": "ZydisFormatterBufferInitTokenized"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:34:25Z"
          }
        }
      ],
      "modified": "2026-10-20T14:34:25.362471033Z",
      "provider": "osv",
      "references": [
        "https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g",
        "https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5",
        "https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784",
        "https://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-41253",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 389715,
  "published_at": "2021-11-08T22:15:16.757+00:00"
}