Samtools
Monthly
A heap-based buffer overflow in HTSlib's fai_retrieve allows a crafted FASTA .fai index to write one byte past the end of an undersized heap allocation, corrupting memory and crashing the process that consumes the file. The bug affects HTSlib releases up to and including 1.23.1, 1.22.2 and 1.21.1, and fires only in the narrow case where the index's recorded line width is exactly one less than the bases-per-line count - any larger discrepancy instead produces a negative-size allocation that fails with NULL and is handled cleanly. According to the CVSS vector the flaw is reachable without authentication (PR:N) but requires the victim to interact with an untrusted index (UI:P), so an attacker must first deliver the malicious .fai file and get the target application to load it and call fai_retrieve; no public exploit is identified at time of analysis and the issue is not in CISA KEV.
Stack-based buffer overflow in HTSlib's CRAM decoder affects all releases before 1.21.2, 1.22.3, 1.23.2, and 1.24: a crafted CRAM record whose query name exceeds the 254-character specification limit is decoded into a 1024-byte stack array before the length check runs, so an overlong name is written past that buffer. Successful exploitation crashes the process or corrupts stack data and may allow arbitrary code execution, though the vendor rates integrity impact high and availability impact low. Reaching the flaw requires that an HTSlib-based application such as samtools or bcftools, or any downstream consumer, open and decode an attacker-supplied CRAM file, so delivery depends on victim interaction; no public exploit code has been identified at time of analysis and the vendor states there is no workaround, only upgrading to a fixed release.
Heap-based memory corruption in HTSlib's CRAM index loader (cram_index_load) lets a malformed .crai index drive out-of-bounds memory access when the victim runs any region query on the associated CRAM file. Affected are HTSlib builds before 1.21.2, 1.22.3, 1.23.2 and 1.24, and because cram_index_load never checks the index's reference-sequence count against the CRAM header's count, an oversized index first causes unbounded allocation (denial of service) and, when the index reference count lands within two of INT_MAX, an integer wrap-around in the array-growth calculation that reads past a heap buffer and uses the value as a write pointer. The CVSS 4.0 base score is 7.1 and the assessed vector is AV:N/AC:L/PR:N/UI:R with high integrity and low availability impact; no public exploit code has been identified at time of analysis, and exploitation requires the victim to process an attacker-supplied index.
Heap out-of-bounds read and write in HTSlib's experimental CRAM v4 XPACK and XRLE decoders allows a remote, unauthenticated attacker to corrupt heap state by supplying a crafted CRAM file. The decoders cache expanded block pointers into the fixed 512-element slice->block_by_id array using an index partially derived from file contents; the resulting out-of-bounds read can crash the process, and when the read returns NULL the subsequent out-of-bounds pointer write can corrupt heap memory and may permit arbitrary code execution. All versions up to and including 1.23.1, 1.22.2 and 1.21.1 are affected and are fixed in 1.21.2, 1.22.3, 1.23.2 and 1.24; no public exploit code was identified at time of analysis, and exposure is gated on whether a target actually decodes experimental CRAM v4 data using these codecs.
Heap buffer overflow in HTSlib's BCF reader allows an attacker-crafted BCF file to corrupt heap memory when opened by an affected version (<= 1.21.1, 1.22.2, 1.23.1, or any release before 1.24). The flaw is an integer overflow in the record-length check inside bcf_record_check(), which lets a record bypass validation so the parser reads past the stored data and, when it sets the least significant bit of each accessed byte, writes past the heap buffer - crashing the process, corrupting data and heap structures, and potentially enabling arbitrary code execution. The CVSS 4.0 vector scores this 8.8 (AV:N/AC:L/PR:N/UI:N/VI:H/VA:L), and the independently assessed CVSS 3.1 vector is AV:N/AC:L/PR:N/UI:R with high integrity and low availability impact and no confidentiality impact; exploitation is unauthenticated but in interactive tools requires the victim to open a malicious BCF file, while automated genomics pipelines ingesting untrusted BCF inputs remove that interaction step. No public exploit code and no CISA KEV entry were identified at time of analysis; the priority label is this_week.
HTSlib, a widely-used bioinformatics library for reading and writing sequence alignment formats, contains a critical buffer overflow vulnerability in its CRAM format decoder. The vulnerability exists in the `cram_byte_array_len_decode()` function which fails to validate that unpacked data matches the output buffer size, affecting HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1. An attacker can craft a malicious CRAM file that, when opened by a user, triggers either a heap or stack overflow with attacker-controlled bytes, potentially leading to arbitrary code execution, program crash, or memory corruption.
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the GZI index loading function `bgzf_index_load_hfile()`. An integer overflow during buffer allocation allows attackers to craft malicious `.gzi` files that trigger heap memory corruption, potentially leading to denial of service, data corruption, or remote code execution when a user opens the compromised file. No evidence of active exploitation in the wild has been reported, but the vulnerability is demonstrable and patch availability is confirmed.
HTSlib versions prior to 1.21.1, 1.22.2, and 1.23.1 contain an out-by-one error in the CRAM decoder's `cram_byte_array_stop_decode_char()` function that allows a single attacker-controlled byte to be written beyond the end of a heap allocation. This heap buffer overflow (CWE-122) affects bioinformatics applications using HTSlib to process CRAM-formatted DNA sequence alignment files, and could enable arbitrary code execution if exploited. No public exploit code or KEV status is currently documented, but patch availability exists for multiple stable release branches.
HTSlib contains a buffer overflow vulnerability in its CRAM format decoder affecting the VARINT and CONST encoding handlers, where incomplete context validation allows writes of up to eight bytes beyond heap allocation boundaries or into stack-allocated single-byte variables. This vulnerability affects HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1, and impacts any application using the library to process CRAM-formatted bioinformatics data files. An attacker can craft a malicious CRAM file to trigger heap or stack overflow conditions, potentially leading to denial of service, memory corruption, or arbitrary code execution when processed by a vulnerable application.
HTSlib contains a heap buffer overflow vulnerability in its CRAM decoder caused by an out-by-one error when validating feature boundaries. When a user opens a maliciously crafted CRAM file, an attacker can write one controlled byte beyond the end of a heap buffer, potentially causing application crashes, data corruption, or arbitrary code execution. Versions 1.23.1, 1.22.2, and 1.21.1 include fixes, and patches are available via the official GitHub repository.
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the cram_decode_seq() function when processing CRAM-formatted bioinformatics files with omitted sequence and quality data. An attacker can craft a malicious CRAM file that triggers an out-of-bounds read followed by an attacker-controlled single-byte write to heap memory, potentially enabling arbitrary code execution, data corruption, or denial of service when a user opens the file. No public exploit proof-of-concept has been identified, but the vulnerability is confirmed and patched by the HTSlib project.
Out-of-bounds reads in HTSlib's CRAM decoders - the BETA codec (cram_beta_decode_long/int/char) and the experimental CRAM v4 XPACK codec (cram_xpack_decode_long/int) - allow a crafted CRAM file to make the library read past the supplied input buffer, leaking information about process state or crashing the process. All releases up to and including 1.23.1, 1.22.2 and 1.21.1 are vulnerable; fixes ship in 1.24, 1.23.2, 1.22.3 and 1.21.2. There is no public exploit identified at time of analysis and no confirmed active exploitation; because the attacker must get the victim to decode a malicious CRAM and the impact is limited to a read, this is a moderate-priority issue for pipelines that ingest untrusted alignment files, not a code-execution emergency.
An out-of-bounds read in HTSlib's experimental CRAM v4 XPACK and XRLE decoders (cram_xpack_decode_char and cram_xrle_decode_char) lets crafted CRAM data drive decode sizes past the expanded input array, so a decoding process can read beyond the supplied buffer and either leak process-state information or crash on invalid memory access. All HTSlib releases up to and including 1.23.1, 1.22.2 and 1.21.1 are affected, with fixes published in 1.24, 1.23.2, 1.22.3 and 1.21.2; per the CVSS vector (AV:N/AC:L/PR:N/UI:N) no authentication or user interaction is required, but exploitation is gated on the target actually parsing attacker-supplied CRAM data through these experimental code paths. Impact is bounded to information disclosure and denial of service rather than code execution, and no public exploit was identified at the time of analysis; the vendor states there is no workaround other than updating.
SAMtools versions 1.17 and later contain a null pointer dereference vulnerability in the cram-size command due to missing error handling for the cram_decode_compression_header() function. When this function fails and returns an error, the code does not properly validate the return value before dereferencing the pointer, allowing an attacker to crash the application by providing a malformed CRAM file. This is a denial-of-service vulnerability with no active exploitation reported in the wild, though patches are available in versions 1.23.1, 1.22.2, and 1.21.1.
SAMtools mpileup command contains a use-after-free vulnerability in reference data management that can leak sensitive program state information or trigger application crashes when processing aligned DNA sequences. The vulnerability affects versions prior to 1.2 and requires no authentication or user interaction to exploit, though a patch is not yet available. An attacker could leverage this to obtain information disclosure or cause denial of service against systems processing bioinformatics data with vulnerable SAMtools versions.
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain an out-of-bounds read vulnerability in the CRAM file parser where the mate reference ID field is not validated during decoding. An attacker can craft a malicious CRAM file that, when processed by affected applications (particularly those converting CRAM to SAM format), triggers out-of-bounds array access that may leak sensitive information about program state or cause a denial of service through memory access violations. No public exploit has been reported, but no workaround exists, making patching essential.
HTSlib versions prior to 1.21.1, 1.22.2, and 1.23.1 contain a buffer over-read vulnerability in the CRAM decoder's cram_decode_seq() function that fails to properly validate feature data offsets. An attacker can craft malicious CRAM files to read arbitrary data from memory adjacent to reference sequence buffers, leading to information disclosure of program state or denial of service through memory access violations. No active exploitation has been documented, but patches are available from the vendor.
HTSlib contains an out-of-bounds read vulnerability in the cram_decode_slice() function that fails to validate the reference ID field early enough during CRAM file parsing, allowing two separate out-of-bounds reads before error detection. The vulnerability affects HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1, and can result in information disclosure through leaked memory values or application crashes when processing malicious or corrupted CRAM bioinformatics files. While the function reports an error after the reads occur, the window for exploitation exists and the practical impact depends on memory layout and application context.
HTSlib, a bioinformatics library for reading and writing sequence alignment formats, contains a null pointer dereference vulnerability in its CRAM format decoder affecting versions before 1.23.1, 1.22.2, and 1.21.1. The vulnerability exists in the CONST, XPACK, and XRLE encodings which fail to properly handle CRAM records with omitted sequence or quality data, causing attempts to write to NULL pointers when these records are decoded. An attacker can exploit this by providing a malformed CRAM file to any application using vulnerable HTSlib versions, resulting in denial of service through application crash, with no known active exploitation or public proof-of-concept at this time.
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not. Rated high severity (CVSS 7.8), this vulnerability is low attack complexity. Public exploit code available.
A heap-based buffer overflow in HTSlib's fai_retrieve allows a crafted FASTA .fai index to write one byte past the end of an undersized heap allocation, corrupting memory and crashing the process that consumes the file. The bug affects HTSlib releases up to and including 1.23.1, 1.22.2 and 1.21.1, and fires only in the narrow case where the index's recorded line width is exactly one less than the bases-per-line count - any larger discrepancy instead produces a negative-size allocation that fails with NULL and is handled cleanly. According to the CVSS vector the flaw is reachable without authentication (PR:N) but requires the victim to interact with an untrusted index (UI:P), so an attacker must first deliver the malicious .fai file and get the target application to load it and call fai_retrieve; no public exploit is identified at time of analysis and the issue is not in CISA KEV.
Stack-based buffer overflow in HTSlib's CRAM decoder affects all releases before 1.21.2, 1.22.3, 1.23.2, and 1.24: a crafted CRAM record whose query name exceeds the 254-character specification limit is decoded into a 1024-byte stack array before the length check runs, so an overlong name is written past that buffer. Successful exploitation crashes the process or corrupts stack data and may allow arbitrary code execution, though the vendor rates integrity impact high and availability impact low. Reaching the flaw requires that an HTSlib-based application such as samtools or bcftools, or any downstream consumer, open and decode an attacker-supplied CRAM file, so delivery depends on victim interaction; no public exploit code has been identified at time of analysis and the vendor states there is no workaround, only upgrading to a fixed release.
Heap-based memory corruption in HTSlib's CRAM index loader (cram_index_load) lets a malformed .crai index drive out-of-bounds memory access when the victim runs any region query on the associated CRAM file. Affected are HTSlib builds before 1.21.2, 1.22.3, 1.23.2 and 1.24, and because cram_index_load never checks the index's reference-sequence count against the CRAM header's count, an oversized index first causes unbounded allocation (denial of service) and, when the index reference count lands within two of INT_MAX, an integer wrap-around in the array-growth calculation that reads past a heap buffer and uses the value as a write pointer. The CVSS 4.0 base score is 7.1 and the assessed vector is AV:N/AC:L/PR:N/UI:R with high integrity and low availability impact; no public exploit code has been identified at time of analysis, and exploitation requires the victim to process an attacker-supplied index.
Heap out-of-bounds read and write in HTSlib's experimental CRAM v4 XPACK and XRLE decoders allows a remote, unauthenticated attacker to corrupt heap state by supplying a crafted CRAM file. The decoders cache expanded block pointers into the fixed 512-element slice->block_by_id array using an index partially derived from file contents; the resulting out-of-bounds read can crash the process, and when the read returns NULL the subsequent out-of-bounds pointer write can corrupt heap memory and may permit arbitrary code execution. All versions up to and including 1.23.1, 1.22.2 and 1.21.1 are affected and are fixed in 1.21.2, 1.22.3, 1.23.2 and 1.24; no public exploit code was identified at time of analysis, and exposure is gated on whether a target actually decodes experimental CRAM v4 data using these codecs.
Heap buffer overflow in HTSlib's BCF reader allows an attacker-crafted BCF file to corrupt heap memory when opened by an affected version (<= 1.21.1, 1.22.2, 1.23.1, or any release before 1.24). The flaw is an integer overflow in the record-length check inside bcf_record_check(), which lets a record bypass validation so the parser reads past the stored data and, when it sets the least significant bit of each accessed byte, writes past the heap buffer - crashing the process, corrupting data and heap structures, and potentially enabling arbitrary code execution. The CVSS 4.0 vector scores this 8.8 (AV:N/AC:L/PR:N/UI:N/VI:H/VA:L), and the independently assessed CVSS 3.1 vector is AV:N/AC:L/PR:N/UI:R with high integrity and low availability impact and no confidentiality impact; exploitation is unauthenticated but in interactive tools requires the victim to open a malicious BCF file, while automated genomics pipelines ingesting untrusted BCF inputs remove that interaction step. No public exploit code and no CISA KEV entry were identified at time of analysis; the priority label is this_week.
HTSlib, a widely-used bioinformatics library for reading and writing sequence alignment formats, contains a critical buffer overflow vulnerability in its CRAM format decoder. The vulnerability exists in the `cram_byte_array_len_decode()` function which fails to validate that unpacked data matches the output buffer size, affecting HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1. An attacker can craft a malicious CRAM file that, when opened by a user, triggers either a heap or stack overflow with attacker-controlled bytes, potentially leading to arbitrary code execution, program crash, or memory corruption.
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the GZI index loading function `bgzf_index_load_hfile()`. An integer overflow during buffer allocation allows attackers to craft malicious `.gzi` files that trigger heap memory corruption, potentially leading to denial of service, data corruption, or remote code execution when a user opens the compromised file. No evidence of active exploitation in the wild has been reported, but the vulnerability is demonstrable and patch availability is confirmed.
HTSlib versions prior to 1.21.1, 1.22.2, and 1.23.1 contain an out-by-one error in the CRAM decoder's `cram_byte_array_stop_decode_char()` function that allows a single attacker-controlled byte to be written beyond the end of a heap allocation. This heap buffer overflow (CWE-122) affects bioinformatics applications using HTSlib to process CRAM-formatted DNA sequence alignment files, and could enable arbitrary code execution if exploited. No public exploit code or KEV status is currently documented, but patch availability exists for multiple stable release branches.
HTSlib contains a buffer overflow vulnerability in its CRAM format decoder affecting the VARINT and CONST encoding handlers, where incomplete context validation allows writes of up to eight bytes beyond heap allocation boundaries or into stack-allocated single-byte variables. This vulnerability affects HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1, and impacts any application using the library to process CRAM-formatted bioinformatics data files. An attacker can craft a malicious CRAM file to trigger heap or stack overflow conditions, potentially leading to denial of service, memory corruption, or arbitrary code execution when processed by a vulnerable application.
HTSlib contains a heap buffer overflow vulnerability in its CRAM decoder caused by an out-by-one error when validating feature boundaries. When a user opens a maliciously crafted CRAM file, an attacker can write one controlled byte beyond the end of a heap buffer, potentially causing application crashes, data corruption, or arbitrary code execution. Versions 1.23.1, 1.22.2, and 1.21.1 include fixes, and patches are available via the official GitHub repository.
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the cram_decode_seq() function when processing CRAM-formatted bioinformatics files with omitted sequence and quality data. An attacker can craft a malicious CRAM file that triggers an out-of-bounds read followed by an attacker-controlled single-byte write to heap memory, potentially enabling arbitrary code execution, data corruption, or denial of service when a user opens the file. No public exploit proof-of-concept has been identified, but the vulnerability is confirmed and patched by the HTSlib project.
Out-of-bounds reads in HTSlib's CRAM decoders - the BETA codec (cram_beta_decode_long/int/char) and the experimental CRAM v4 XPACK codec (cram_xpack_decode_long/int) - allow a crafted CRAM file to make the library read past the supplied input buffer, leaking information about process state or crashing the process. All releases up to and including 1.23.1, 1.22.2 and 1.21.1 are vulnerable; fixes ship in 1.24, 1.23.2, 1.22.3 and 1.21.2. There is no public exploit identified at time of analysis and no confirmed active exploitation; because the attacker must get the victim to decode a malicious CRAM and the impact is limited to a read, this is a moderate-priority issue for pipelines that ingest untrusted alignment files, not a code-execution emergency.
An out-of-bounds read in HTSlib's experimental CRAM v4 XPACK and XRLE decoders (cram_xpack_decode_char and cram_xrle_decode_char) lets crafted CRAM data drive decode sizes past the expanded input array, so a decoding process can read beyond the supplied buffer and either leak process-state information or crash on invalid memory access. All HTSlib releases up to and including 1.23.1, 1.22.2 and 1.21.1 are affected, with fixes published in 1.24, 1.23.2, 1.22.3 and 1.21.2; per the CVSS vector (AV:N/AC:L/PR:N/UI:N) no authentication or user interaction is required, but exploitation is gated on the target actually parsing attacker-supplied CRAM data through these experimental code paths. Impact is bounded to information disclosure and denial of service rather than code execution, and no public exploit was identified at the time of analysis; the vendor states there is no workaround other than updating.
SAMtools versions 1.17 and later contain a null pointer dereference vulnerability in the cram-size command due to missing error handling for the cram_decode_compression_header() function. When this function fails and returns an error, the code does not properly validate the return value before dereferencing the pointer, allowing an attacker to crash the application by providing a malformed CRAM file. This is a denial-of-service vulnerability with no active exploitation reported in the wild, though patches are available in versions 1.23.1, 1.22.2, and 1.21.1.
SAMtools mpileup command contains a use-after-free vulnerability in reference data management that can leak sensitive program state information or trigger application crashes when processing aligned DNA sequences. The vulnerability affects versions prior to 1.2 and requires no authentication or user interaction to exploit, though a patch is not yet available. An attacker could leverage this to obtain information disclosure or cause denial of service against systems processing bioinformatics data with vulnerable SAMtools versions.
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain an out-of-bounds read vulnerability in the CRAM file parser where the mate reference ID field is not validated during decoding. An attacker can craft a malicious CRAM file that, when processed by affected applications (particularly those converting CRAM to SAM format), triggers out-of-bounds array access that may leak sensitive information about program state or cause a denial of service through memory access violations. No public exploit has been reported, but no workaround exists, making patching essential.
HTSlib versions prior to 1.21.1, 1.22.2, and 1.23.1 contain a buffer over-read vulnerability in the CRAM decoder's cram_decode_seq() function that fails to properly validate feature data offsets. An attacker can craft malicious CRAM files to read arbitrary data from memory adjacent to reference sequence buffers, leading to information disclosure of program state or denial of service through memory access violations. No active exploitation has been documented, but patches are available from the vendor.
HTSlib contains an out-of-bounds read vulnerability in the cram_decode_slice() function that fails to validate the reference ID field early enough during CRAM file parsing, allowing two separate out-of-bounds reads before error detection. The vulnerability affects HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1, and can result in information disclosure through leaked memory values or application crashes when processing malicious or corrupted CRAM bioinformatics files. While the function reports an error after the reads occur, the window for exploitation exists and the practical impact depends on memory layout and application context.
HTSlib, a bioinformatics library for reading and writing sequence alignment formats, contains a null pointer dereference vulnerability in its CRAM format decoder affecting versions before 1.23.1, 1.22.2, and 1.21.1. The vulnerability exists in the CONST, XPACK, and XRLE encodings which fail to properly handle CRAM records with omitted sequence or quality data, causing attempts to write to NULL pointers when these records are decoded. An attacker can exploit this by providing a malformed CRAM file to any application using vulnerable HTSlib versions, resulting in denial of service through application crash, with no known active exploitation or public proof-of-concept at this time.
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not. Rated high severity (CVSS 7.8), this vulnerability is low attack complexity. Public exploit code available.