Skip to content
Heist/ feed
Back to feed
HighFix available

htslib — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2026-31968

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data using a variety of encodings and compression methods. For the `VARINT` and `CONST` encodings, incomplete validation of the context in which the encodings were used could result in up to eight bytes being written beyond the end of a heap allocation, or up to eight bytes being written to the location of a one byte variable on the stack, possibly causing the values to adjacent variables to change unexpectedly. Depending on the data stream this could result either in a heap buffer overflow or a stack overflow. If a user opens a file crafted to exploit this issue it could lead to the program crashing, overwriting of data structures on the heap or stack in ways not expected by the program, or changing the control flow of the program. It may be possible to use this to obtain arbitrary code execution. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.

Products
htslib
Affected versions
1.16+ds-3, 1.17+ds-0+exp1, 1.17+ds-1, 1.18+ds-0+exp1, 1.18+ds-1, 1.19+ds-0+exp0, 1.19+ds-1, 1.19+ds-1+exp1, 1.19+ds-1.1, 1.20+ds-1, 1.20+ds-2, 1.21+ds-0+exp1, 1.21+ds-0+exp2, 1.21+ds-1, 1.22.1+ds-1, 1.22.1+ds-2, 1.22.1+ds2-1, 1.24-1, 1.24-2, 1.24-3
Fixed versions
1.24-2
CVEs
CVE-2026-31968
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 08:20 UTC · Revision 1

Source evidence

DEBIAN-CVE-2026-31968

core-osv · Original source

Published 18 Mar 2026, 20:16 UTC

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data using a variety of encodings and compression methods. For the `VARINT` and `CONST` encodings, incomplete validation of the context in which the encodings were used could result in up to eight bytes being written beyond the end of a heap allocation, or up to eight bytes being written to the location of a one byte variable on the stack, possibly causing the values to adjacent variables to change unexpectedly. Depending on the data stream this could result either in a heap buffer overflow or a stack overflow. If a user opens a file crafted to exploit this issue it could lead to the program crashing, overwriting of data structures on the heap or stack in ways not expected by the program, or changing the control flow of the program. It may be possible to use this to obtain arbitrary code execution. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.

osv:DEBIAN-CVE-2026-31968

htslib

Fixed versions: Not specified

htslib

Fixed versions: Not specified

htslib

Fixed versions: 1.24-2

Complete source record
{
  "id": "b642a81ed2bc98df8dc8b6dfab9708f1b0773856590e2e2c9bcf4e1b971e7b54",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-31968",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2026-31968",
    "summary": "HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data using a variety of encodings and compression methods. For the `VARINT` and `CONST` encodings, incomplete validation of the context in which the encodings were used could result in up to eight bytes being written beyond the end of a heap allocation, or up to eight bytes being written to the location of a one byte variable on the stack, possibly causing the values to adjacent variables to change unexpectedly. Depending on the data stream this could result either in a heap buffer overflow or a stack overflow. If a user opens a file crafted to exploit this issue it could lead to the program crashing, overwriting of data structures on the heap or stack in ways not expected by the program, or changing the control flow of the program. It may be possible to use this to obtain arbitrary code execution. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.",
    "evidence": "osv:DEBIAN-CVE-2026-31968",
    "products": [
      {
        "name": {
          "value": "htslib",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.16+ds-3",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.17+ds-0+exp1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.17+ds-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.18+ds-0+exp1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.18+ds-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.19+ds-0+exp0",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.19+ds-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.19+ds-1+exp1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.19+ds-1.1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.20+ds-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.20+ds-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.21+ds-0+exp1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.21+ds-0+exp2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.21+ds-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.22.1+ds-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.22.1+ds-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.22.1+ds2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.24-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.24-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.24-3",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "htslib",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.21+ds-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.22.1+ds-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.22.1+ds-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.22.1+ds2-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.24-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.24-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.24-3",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "htslib",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.24-2",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "1.21+ds-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.22.1+ds-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.22.1+ds-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.22.1+ds2-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.24-1",
            "evidence": "/affected/2/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2026-31968",
      "aliases": [
        "DEBIAN-CVE-2026-31968"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "htslib",
            "purl": "pkg:deb/debian/htslib?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "versions": [
            "1.16+ds-3",
            "1.17+ds-0+exp1",
            "1.17+ds-1",
            "1.18+ds-0+exp1",
            "1.18+ds-1",
            "1.19+ds-0+exp0",
            "1.19+ds-1",
            "1.19+ds-1+exp1",
            "1.19+ds-1.1",
            "1.20+ds-1",
            "1.20+ds-2",
            "1.21+ds-0+exp1",
            "1.21+ds-0+exp2",
            "1.21+ds-1",
            "1.22.1+ds-1",
            "1.22.1+ds-2",
            "1.22.1+ds2-1",
            "1.24-1",
            "1.24-2",
            "1.24-3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-31968.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "htslib",
            "purl": "pkg:deb/debian/htslib?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "versions": [
            "1.21+ds-1",
            "1.22.1+ds-1",
            "1.22.1+ds-2",
            "1.22.1+ds2-1",
            "1.24-1",
            "1.24-2",
            "1.24-3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-31968.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.24-2"
                }
              ]
            }
          ],
          "package": {
            "name": "htslib",
            "purl": "pkg:deb/debian/htslib?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "versions": [
            "1.21+ds-1",
            "1.22.1+ds-1",
            "1.22.1+ds-2",
            "1.22.1+ds2-1",
            "1.24-1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-31968.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-19T17:00:07.134423357Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-31968"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2026-31968"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-31968",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 375451,
  "published_at": "2026-03-18T20:16:21.48+00:00"
}