{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "0"
                  },
                  {
                    "last_affected": "1.24"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              },
              {
                "range": [
                  {
                    "fixed": "18dddf02bb2c0053b32acec427723555a24b2873"
                  }
                ],
                "source": "REFERENCES_COMMIT"
              }
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "18dddf02bb2c0053b32acec427723555a24b2873"
            }
          ],
          "repo": "https://github.com/samtools/htslib",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-197"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/116xxx/CVE-2026-116742.json"
  },
  "details": "HTSlib through 1.24 contains a heap out-of-bounds write and read vulnerability in bgzf_index_load_hfile() in bgzf.c that allows attackers to corrupt heap memory by supplying a crafted .gzi index entry count. A count of 0xFFFFFFFF truncates noffs to zero, causing writes past a malloc(0) buffer and an offs[-1] read in bgzf_useek(), resulting in heap corruption or crashes in tools like samtools and bcftools.",
  "id": "CVE-2026-116742",
  "modified": "2026-10-29T02:31:10.580688088Z",
  "published": "2026-10-26T21:52:41.511Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/116xxx/CVE-2026-116742.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://hackmd.io/@haindpwn/htslib-bgzf-gzi-int-truncation-oob"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-116742"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/htslib-through-1.24-heap-out-of-bounds-write-via-truncated-gzi-index-count"
    },
    {
      "type": "REPORT",
      "url": "https://github.com/samtools/htslib/issues/2113"
    },
    {
      "type": "FIX",
      "url": "https://github.com/samtools/htslib/commit/18dddf02bb2c0053b32acec427723555a24b2873"
    },
    {
      "type": "FIX",
      "url": "https://github.com/samtools/htslib/pull/2057"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/samtools/htslib"
    },
    {
      "type": "ARTICLE",
      "url": "https://github.com/samtools/htslib/blob/1.24/bgzf.c#L2504"
    }
  ],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "HTSlib through 1.24 Heap Out-of-Bounds Write via Truncated .gzi Index Count"
}