5.7medium
Infinite loop in parsing PNG files in
- Severity
- 5.7medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.53% (higher than 75% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-px9g-8hgv-jvg2RUSTSEC-2021-0143
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| kamadak exif-rs | = 0.5.2 | CVE List |
| kamadak-exif (crates.io) | from 0.5.2 before 0.5.3 | GitHub Advisory Database, RustSec Advisory Database |
| kamadak-exif_project kamadak-exif | 0.5.2 | NVD |
All scores
| GitHub_M | 5.7medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| RustSec Advisory Database | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
Impact
Reader::read_from_container can cause an infinite loop when a crafted PNG file is given.
Patches
Version 0.5.3 includes the fix.
Workarounds
No workaround is available. Applications that do not pass files with the PNG signature to Reader::read_from_container are not affected.
References
- https://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21235
For more information
If you have any questions or comments about this advisory:
- Open an issue in github.com/kamadak/exif-rs
RustSec Advisory Database
Attacker crafted data can cause a infinite loop leading to DoS if used with untrusted data.
NVD (es)
kamadak-exif es una biblioteca de análisis exif escrita en Rust puro. En kamadak-exif versión 0.5.2, Se presenta un bucle infinito en el análisis de archivos PNG diseñados. Específicamente, la función reader::read_from_container puede causar un bucle infinito cuando se le proporciona un archivo PNG diseñado. Esto es corregido en la versión 0.5.3. Ninguna solución alternativa está disponible. Las aplicaciones que no aprueban archivos con la firma PNG a la función Reader::read_from_container no están afectadas
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21235 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-px9g-8hgv-jvg2 changed 2026-07-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0143 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-21235 changed 2026-06-17 | Public domain |