Skip to content
Heist/ feed
Back to feed
HighFix available

htslib — security advisory

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

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. In the `cram_decode_slice()` function called while reading CRAM records, validation of the reference id field occurred too late, allowing two out of bounds reads to occur before the invalid data was detected. The bug does allow two values to be leaked to the caller, however as the function reports an error it may be difficult to exploit them. It is also possible that the program will crash due to trying to access invalid memory. 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-31965
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 08:20 UTC · Revision 1

Source evidence

DEBIAN-CVE-2026-31965

core-osv · Original source

Published 18 Mar 2026, 19:16 UTC

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. In the `cram_decode_slice()` function called while reading CRAM records, validation of the reference id field occurred too late, allowing two out of bounds reads to occur before the invalid data was detected. The bug does allow two values to be leaked to the caller, however as the function reports an error it may be difficult to exploit them. It is also possible that the program will crash due to trying to access invalid memory. 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-31965

htslib

Fixed versions: Not specified

htslib

Fixed versions: Not specified

htslib

Fixed versions: 1.24-2

Complete source record
{
  "id": "89d18fc33a39ab976a60bef14292f237e1e610679645b9812030c1153a8c70ee",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-31965",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2026-31965",
    "summary": "HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. In the `cram_decode_slice()` function called while reading CRAM records, validation of the reference id field occurred too late, allowing two out of bounds reads to occur before the invalid data was detected. The bug does allow two values to be leaked to the caller, however as the function reports an error it may be difficult to exploit them. It is also possible that the program will crash due to trying to access invalid memory. 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-31965",
    "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-31965",
      "aliases": [
        "DEBIAN-CVE-2026-31965"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/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-31965.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-31965.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-31965.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-19T17:00:07.080321061Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-31965"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2026-31965"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-31965",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 375443,
  "published_at": "2026-03-18T19:16:04.823+00:00"
}