CVEfocus › CVE database › CVE-2021-28876

CVE-2021-28876

CVSS 5.3 MediumEPSS 1.6% (higher than 76% of CVEs)Published 2021-04-11Updated 2024-08-03Assigner: mitre

In the standard library in Rust before 1.52.0, the Zip implementation has a panic safety issue. It calls __iterator_get_unchecked() more than once for the same index when the underlying iterator panics (in certain conditions). This bug could lead to a memory safety violation due to an unmet safety requirement for the TrustedRandomAccess trait.

What to do

Fixed builds are available from Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

21Fixed
2Fix pending
16Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04rustcNot affected
vulnerable_code_not_present
Ubuntu 22.04rustcFixed1.53.0+dfsg1+llvm-4ubuntu1UBUNTU-CVE-2021-28876
Ubuntu 20.04rustcFixed1.53.0+dfsg1+llvm-4ubuntu1~20.04.1UBUNTU-CVE-2021-28876
Ubuntu 16.04rustcFix pendingUBUNTU-CVE-2021-28876
Ubuntu 14.04rustcFix pendingUBUNTU-CVE-2021-28876
Debian 14rustcFixed1.53.0+dfsg1-1DEBIAN-CVE-2021-28876
Debian 13rustcFixed1.53.0+dfsg1-1DEBIAN-CVE-2021-28876
Debian 12rustcFixed1.53.0+dfsg1-1DEBIAN-CVE-2021-28876
Red Hat Enterprise Linux 9cargoNot affected
Red Hat Enterprise Linux 9clippyNot affected
Red Hat Enterprise Linux 9rustNot affected
Red Hat Enterprise Linux 9rust-analysisNot affected
Red Hat Enterprise Linux 9rust-analyzerNot affected
Red Hat Enterprise Linux 9rust-debugger-commonNot affected
Red Hat Enterprise Linux 9rust-docNot affected
Red Hat Enterprise Linux 9rust-gdbNot affected
Red Hat Enterprise Linux 9rust-lldbNot affected
Red Hat Enterprise Linux 9rust-srcNot affected
Red Hat Enterprise Linux 9rust-std-staticNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 9rust-toolsetNot affected
Red Hat Enterprise Linux 9rustfmtNot affected
Red Hat Enterprise Linux 8cargoFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8cargo-docFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8clippyFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rlsFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rustFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-analysisFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-debugger-commonFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-docFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-gdbFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-lldbFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-srcFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-std-staticFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rust-toolsetFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Red Hat Enterprise Linux 8rustfmtFixed0:1.52.1-1.module+el8.4.0+11282+0729bac9RHSA-2021:3063
Rocky Linux 8rustFixed0:1.52.1-1.module+el8.4.0+641+ca238f88RLSA-2021:3063
Rocky Linux 8rust-toolsetFixed0:1.52.1-1.module+el8.4.0+641+ca238f88RLSA-2021:3063

What the vendor says

As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.