# CVE-2021-21235: Infinite loop in parsing PNG files in

- Severity: Medium 5.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.53%, higher than 75% of CVEs (2026-12-01)
- Published: 2021-01-04T12:00:00.000Z
- Modified: 2026-07-08T06:27:46.767Z
- Also known as: GHSA-px9g-8hgv-jvg2, RUSTSEC-2021-0143
- Weaknesses: CWE-400, CWE-835
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- kamadak exif-rs: = 0.5.2
- kamadak-exif (crates.io): from 0.5.2 before 0.5.3
- kamadak-exif_project kamadak-exif: 0.5.2

## Every score

- GitHub_M: CVSS:3.1 5.7 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- RustSec Advisory Database: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:N/A:P`

## References

- <https://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2> (third-party-advisory, web)
- <https://crates.io/crates/kamadak-exif> (package, product, third-party-advisory, web)
- <https://github.com/kamadak/exif-rs/commit/f21df24616ea611c5d5d0e0e2f8042eb74d5ff48> (patch, 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> (advisory, web)

## Sources

- CVE List: [CVE-2021-21235](https://www.cve.org/CVERecord?id=CVE-2021-21235), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-px9g-8hgv-jvg2](https://github.com/advisories/GHSA-px9g-8hgv-jvg2), CC-BY-4.0, modified 2026-07-08
- RustSec Advisory Database: [RUSTSEC-2021-0143](https://rustsec.org/advisories/RUSTSEC-2021-0143.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2021-21235](https://nvd.nist.gov/vuln/detail/CVE-2021-21235), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-21235 · Whole record: https://cve.day/CVE-2021-21235.json · Rebuilt by cve.day 2026-11-25T22:57:59.153Z
