CVE-2021-21235
MEDIUM 6.5CVSS 3.1kamadak-exif vulnerable to Infinite loop when parsing PNG files
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.
- Published
- 6 Jan 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-400CWE-835
- Also known as
- GHSA-px9g-8hgv-jvg2RUSTSEC-2021-0143
- Sources
- NVDJSONOSV GHSA-px9g-8hgv-jvg2JSONOSV RUSTSEC-2021-0143JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| OSV | RustSec | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.7 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | kamadak-exif_project | kamadak-exifcpe:2.3:a:kamadak-exif_project:kamadak-exif:0.5.2:*:*:*:*:rust:*:* |
= 0.5.2 | |
| OSV | crates.io | kamadak-exif | >= 0.5.2, < 0.5.3 | 0.5.3 |
References
- https://crates.io/crates/kamadak-exif · Product, Third Party Advisory, WEB, PACKAGE
- https://github.com/kamadak/exif-rs/commit/f21df24616ea611c5d5d0e0e2f8042eb74d5ff48 · Patch, Third Party Advisory, WEB
- https://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2 · Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-21235 · ADVISORY
- https://github.com/kamadak/exif-rs/commit/1b05eab57e484cd7d576d4357b9cda7fdc57df8c · WEB
- https://github.com/kamadak/exif-rs · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2021-0143.html · WEB, ADVISORY
History
- 25 Nov 2026 20:32 UTC · NVD: first stored (published 6 Jan 2021)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 4 Jan 2021)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 6 Oct 2022)