CVE-2021-21235Infinite loop in parsing PNG files in
kamadak-exif is an exif parsing library written in pure Rust. In kamadak-exif version 0.5.2, there is an infinite loop in parsing crafted PNG files. Specifically, reader::read_from_container can cause an infinite loop when a crafted PNG file is given. This is fixed in version 0.5.3. No workaround is available. Applications that do not pass files with the PNG signature to Reader::read_from_container are not affected.
What to do
Fixed builds are available from crates.io: 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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | rust-kamadak-exif | Fix pending | UBUNTU-CVE-2021-21235 | |
| Ubuntu 26.04 | rust-kamadak-exif | Under investigation | UBUNTU-CVE-2021-21235 | |
| Ubuntu 25.10 | rust-kamadak-exif | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-21235 | |
| Ubuntu 24.04 | rust-kamadak-exif | Under investigation | UBUNTU-CVE-2021-21235 | |
| Ubuntu 22.04 | rust-kamadak-exif | Under investigation | UBUNTU-CVE-2021-21235 | |
| Ubuntu 20.04 | rust-kamadak-exif | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-21235 | |
| crates.io library | kamadak-exif | Fixed | 0.5.3 | GHSA-px9g-8hgv-jvg2 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- kamadak exif-rs: affected: = 0.5.2
References
- https://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2
- https://crates.io/crates/kamadak-exif
- https://github.com/kamadak/exif-rs/commit/f21df24616ea611c5d5d0e0e2f8042eb74d5ff48
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.