RUSTSEC-2017-0004

    Dashboard / Vulnerabilities / RUSTSEC-2017-0004

    RUSTSEC-2017-0004

    Published: 3 May 2017Last Modified: 8 Nov 2023

    Summary: Integer overflow leads to heap-based buffer overflow in encode_config_buf

    Details: Affected versions of this crate suffered from an integer overflow bug when calculating the size of a buffer to use when encoding base64 using the `encode_config_buf` and `encode_config` functions. If the input string was large, this would cause a buffer to be allocated that was too small. Since this function writes to the buffer using unsafe code, it would allow an attacker to write beyond the buffer, causing memory corruption and possibly the execution of arbitrary code. This flaw was corrected by using checked arithmetic to calculate the size of the buffer.

    Affected packages

    Package

    Name: base64

    Purl: pkg:cargo/base64

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0.0.0-0
    Fixed -0.5.2

    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