Advisory

RUSTSEC-2017-0004

Also known as: CVE-2017-1000430, GHSA-x67x-vg9m-65c3

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2017-05-03 12:00 UTC
Modified
2023-11-08 03:58 UTC

Affected packages and fixes

base64

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.5.2 (semver)

Fixed versions

0.5.2

Fix

  • Fixed version 0.5.2
    cargo update -p base64 --precise 0.5.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences