{"id":"CVE-2021-21235","aliases":["CVE-2021-21235","GHSA-px9g-8hgv-jvg2","RUSTSEC-2021-0143"],"related":[],"kind":"vulnerability","state":"published","title":"Infinite loop in parsing PNG files in","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nReader::read_from_container can cause an infinite loop when a crafted PNG file is given.\n\n### Patches\nVersion 0.5.3 includes the fix.\n\n### Workarounds\nNo workaround is available.\nApplications that do not pass files with the PNG signature to Reader::read_from_container are not affected.\n\n### References\n* <https://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2>\n* <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21235>\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [github.com/kamadak/exif-rs](https://github.com/kamadak/exif-rs)","format":"markdown","source":"ghsa"},{"lang":"en","text":"Attacker crafted data can cause a infinite loop leading to DoS if used with untrusted data.","format":"markdown","source":"rustsec"},{"lang":"es","text":"kamadak-exif es una biblioteca de análisis exif escrita en Rust puro.&#xa0;En kamadak-exif versión 0.5.2, Se presenta un bucle infinito en el análisis de archivos PNG diseñados.&#xa0;Específicamente, la función reader::read_from_container puede causar un bucle infinito cuando se le proporciona un archivo PNG diseñado.&#xa0;Esto es corregido en la versión 0.5.3. Ninguna solución alternativa está disponible.&#xa0;Las aplicaciones que no aprueban archivos con la firma PNG a la función Reader::read_from_container no están afectadas","source":"nvd"}],"published":"2021-01-04T12:00:00.000Z","modified":"2026-07-08T06:27:46.767Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","score":5.7,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","score":5.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:N/A:P","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-835"],"affected":[{"ranges":[{"version":"= 0.5.2","status":"affected"}],"vendor":"kamadak","product":"exif-rs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.5.2","status":"affected","fixed":"0.5.3"}],"ecosystem":"crates.io","package":"kamadak-exif","purl":"pkg:cargo/kamadak-exif","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.5.2","status":"affected","fixed":"0.5.3"}],"ecosystem":"crates.io","package":"kamadak-exif","purl":"pkg:cargo/kamadak-exif","source":"rustsec"},{"ranges":[{"status":"affected","version":"0.5.2"}],"vendor":"kamadak-exif_project","product":"kamadak-exif","cpe":"cpe:2.3:a:kamadak-exif_project:kamadak-exif:0.5.2:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://crates.io/crates/kamadak-exif","tags":["package","product","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://github.com/kamadak/exif-rs/commit/f21df24616ea611c5d5d0e0e2f8042eb74d5ff48","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21235","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/kamadak/exif-rs/commit/1b05eab57e484cd7d576d4357b9cda7fdc57df8c","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/kamadak/exif-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0143.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21235","url":"https://www.cve.org/CVERecord?id=CVE-2021-21235","licence":"CVE Terms of Use","modified":"2024-08-03T18:09:14.897Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-px9g-8hgv-jvg2","url":"https://github.com/advisories/GHSA-px9g-8hgv-jvg2","licence":"CC-BY-4.0","modified":"2026-07-08T06:27:46.767Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0143","url":"https://rustsec.org/advisories/RUSTSEC-2021-0143.html","licence":"CC0-1.0","modified":"2023-11-08T04:04:38.884Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21235","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21235","licence":"Public domain","modified":"2026-06-17T03:35:05.807Z"}],"updatedAt":"2026-11-25T22:57:59.153Z","epss":{"score":0.01534,"percentile":0.75556,"date":"2026-12-01T12:00:22.000Z"}}