Rust advisories / truetype
Vulnerability HighRUSTSEC-2021-0029 · truetype
RUSTSEC-2021-0029: Tape::take_bytes exposes uninitialized memory to a user-provided Read
Short answerA security vulnerability in the truetype crate: Tape::take_bytes exposes uninitialized memory to a user-provided Read. High severity (CVSS 7.5). Fixed in 0.30.1: update to a fixed version.
| Crate | truetype |
|---|---|
| Type | Vulnerability (memory-exposure) |
| Affected versions | Before 0.30.1. |
| Fixed in | 0.30.1 |
| Severity | High, CVSS 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| Published | 2021-02-17 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-28030, GHSA-v7q4-97x4-4qw2 |
What to do
- See which version you have:
cargo tree -i truetype(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p truetype. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampletruetype = "0.30.1") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Affected versions of this crate passed an unininitialized buffer to a user-provided Read instance in Tape::take_bytes.
This can result in safe Read implementations reading from the uninitialized buffer leading to undefined behavior.
The flaw was corrected in commit 1f2dc7f37dd by removing the unsafe block and zero-initializing the buffer.
References
- Package: crates.io/crates/truetype
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0029.html
- Report: github.com/bodoni/truetype/issues/11
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?