- Reported
-
- Issued
-
- Package
-
bam
(crates.io)
- Type
-
Vulnerability
- Categories
-
- Aliases
-
- References
-
- CVSS Score
- 9.8
CRITICAL
- CVSS Details
-
- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality Impact
- High
- Integrity Impact
- High
- Availability Impact
- High
- CVSS Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Patched
-
- Affected Functions
- Version
bam::bgzip::Block::load
-
Description
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.
Advisory available under CC0-1.0
license.