Skip to content
Heist/ feed
Back to feed
HighFix available

htslib — security advisory

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

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. While most alignment records store DNA sequence and quality values, the format also allows them to omit this data in certain cases to save space. Due to some quirks of the CRAM format, it is necessary to handle these records carefully as they will actually store data that needs to be consumed and then discarded. Unfortunately the `cram_decode_seq()` did not handle this correctly in some cases. Where this happened it could result in reading a single byte from beyond the end of a heap allocation, followed by writing a single attacker-controlled byte to the same location. Exploiting this bug causes a heap buffer overflow. If a user opens a file crafted to exploit this issue, it could lead to the program crashing, or overwriting of data and heap structures in ways not expected by 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-31962
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 08:20 UTC · Revision 1

Source evidence

DEBIAN-CVE-2026-31962

core-osv · Original source

Published 18 Mar 2026, 18:16 UTC

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. While most alignment records store DNA sequence and quality values, the format also allows them to omit this data in certain cases to save space. Due to some quirks of the CRAM format, it is necessary to handle these records carefully as they will actually store data that needs to be consumed and then discarded. Unfortunately the `cram_decode_seq()` did not handle this correctly in some cases. Where this happened it could result in reading a single byte from beyond the end of a heap allocation, followed by writing a single attacker-controlled byte to the same location. Exploiting this bug causes a heap buffer overflow. If a user opens a file crafted to exploit this issue, it could lead to the program crashing, or overwriting of data and heap structures in ways not expected by 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-31962

htslib

Fixed versions: Not specified

htslib

Fixed versions: Not specified

htslib

Fixed versions: 1.24-2

Complete source record
{
  "id": "8a670f642390569a1398ac1c5b0b7f1b2c865eaba8fd7a1152c7580dfdf89a29",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-31962",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2026-31962",
    "summary": "HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. While most alignment records store DNA sequence and quality values, the format also allows them to omit this data in certain cases to save space. Due to some quirks of the CRAM format, it is necessary to handle these records carefully as they will actually store data that needs to be consumed and then discarded. Unfortunately the `cram_decode_seq()` did not handle this correctly in some cases. Where this happened it could result in reading a single byte from beyond the end of a heap allocation, followed by writing a single attacker-controlled byte to the same location. Exploiting this bug causes a heap buffer overflow. If a user opens a file crafted to exploit this issue, it could lead to the program crashing, or overwriting of data and heap structures in ways not expected by 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-31962",
    "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-31962",
      "aliases": [
        "DEBIAN-CVE-2026-31962"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/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-31962.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-31962.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-31962.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-19T17:00:07.128552506Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-31962"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2026-31962"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-31962",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 375450,
  "published_at": "2026-03-18T18:16:28.19+00:00"
}