RUSTSEC-2021-0027

    Dashboard / Vulnerabilities / RUSTSEC-2021-0027

    RUSTSEC-2021-0027

    Published: 7 Jan 2021Last Modified: 8 Nov 2023

    Summary: Loading a bgzip block can write out of bounds if size overflows.

    Details: 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.

    Affected packages

    Package

    Name: bam

    Purl: pkg:cargo/bam

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0.0.0-0
    Fixed -0.1.3

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    RUSTSEC-2021-0027 | CVE-DB