9.8critical
Loading a bgzip block can write out of bounds if size overflows.
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 1.31% (higher than 71% of CVEs)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-cpqj-r29q-chrhRUSTSEC-2021-0027
Description
An issue was discovered in the bam crate before 0.1.3 for Rust. There is an integer underflow and out-of-bounds write during the loading of a bgzip block.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| bam (crates.io) | before 0.1.3, from 0.0.0-0 before 0.1.3 | GitHub Advisory Database, RustSec Advisory Database |
| bam_project bam | before 0.1.3 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| RustSec Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
An issue was discovered in the bam crate before 0.1.3 for Rust. There is an integer underflow and out-of-bounds write during the loading of a bgzip block.
RustSec Advisory Database
Affected versions of bam set the length of an internal buffer using
self.compressed.set_len(block_size - HEADER_SIZE - MIN_EXTRA_SIZE) and then
wrote into it. While block_size was constrained to a proper maximum, when it
was too small the subtraction could overflow negatively to a large number past
the capacity of self.compressed.
This can result in memory corruption in the form of writing out of bounds when
loading a bgzip file with a small block_size.
Commit 061eee38d4 fixed this issue by checking for the underflow when setting
the buffer size.
NVD (es)
Se detectó un problema en la crate bam versiones anteriores a 0.1.3 para Rust. Se presenta un subdesbordamiento de enteros y una escritura fuera de límites durante la carga de un bloque bgzip
References
| https://rustsec.org/advisories/RUSTSEC-2021-0027.html | advisory, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-28027 | advisory | |
| https://gitlab.com/tprodanov/bam | package | |
| https://gitlab.com/tprodanov/bam/-/issues/4 | report, web | |
| https://crates.io/crates/bam | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-28027 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-cpqj-r29q-chrh changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0027 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-28027 changed 2026-06-17 | Public domain |