{"id":"CVE-2021-21235","aliases":["EUVD-2022-7148","GHSA-px9g-8hgv-jvg2","RUSTSEC-2021-0143","UBUNTU-CVE-2021-21235"],"status":"published","title":"Infinite loop in parsing PNG files in","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.","severity":{"version":"3.1","score":5.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.01534,"percentile":0.75028,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-400","CWE-835"],"published":"2021-01-04T12:00:00Z","modified":"2026-10-20T10:54:28Z","fixes":[{"ecosystem":"crates.io","package":"kamadak-exif","fixed_in":["0.5.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"kamadak-exif","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.5.2"},{"last_affected":"0.5.2"},{"fixed":"0.5.3"}]}],"versions":["0.5.2"]},{"source":"osv","ecosystem":"crates.io","package":"kamadak-exif","ranges":[{"type":"SEMVER","events":[{"introduced":"0.5.2"},{"fixed":"0.5.3"}]}],"versions":["0.5.2"]},{"source":"osv","ecosystem":"crates.io","package":"kamadak-exif","ranges":[{"type":"SEMVER","events":[{"introduced":"0.5.2"},{"fixed":"0.5.3"}]}]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"rust-kamadak-exif","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.3.1-2"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"rust-kamadak-exif","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.3.1-2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"rust-kamadak-exif","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.5.5-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"rust-kamadak-exif","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.5.5-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"rust-kamadak-exif","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.6.1-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"rust-kamadak-exif","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.5.5-1","0.6.1-1"]}],"products":[{"vendor":"kamadak","product":"exif-rs"},{"vendor":"kamadak-exif_project","product":"kamadak-exif"}],"references":[{"url":"https://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web","report"]},{"url":"https://crates.io/crates/kamadak-exif","tags":["x_refsource_MISC","x_transferred","Product","Third Party Advisory","advisory","web","package","report"]},{"url":"https://github.com/kamadak/exif-rs/commit/f21df24616ea611c5d5d0e0e2f8042eb74d5ff48","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21235","tags":["advisory"]},{"url":"https://github.com/kamadak/exif-rs/commit/1b05eab57e484cd7d576d4357b9cda7fdc57df8c","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0143.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-px9g-8hgv-jvg2"},{"url":"https://github.com/kamadak/exif-rs","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2021-21235","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-21235","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2021-21235","title":"Infinite loop in parsing PNG files in","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.","status":"published","published":"2021-01-06T01:15:14Z","modified":"2024-08-03T18:09:14.897Z","cvss":[{"version":"3.1","score":5.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-400"],"updated_at":"2026-11-02T14:33:00.137099Z"}],"euvd":[{"id":"EUVD-2022-7148","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.","status":"published","published":"2021-01-06T01:15:14Z","modified":"2024-08-03T18:09:14Z","cvss":[{"version":"3.1","score":5.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-03T03:25:06.913643Z"}],"ghsa":[{"id":"GHSA-px9g-8hgv-jvg2","title":"kamadak-exif vulnerable to Infinite loop when parsing PNG files","description":"### 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* \u003chttps://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2\u003e\n* \u003chttps://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21235\u003e\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)","status":"published","published":"2022-10-06T19:53:39Z","modified":"2023-02-02T05:08:27Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-400","CWE-835"],"updated_at":"2026-11-02T14:36:41.247728Z"}],"nvd":[{"id":"CVE-2021-21235","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.","status":"published","published":"2021-01-06T02:15:12.967Z","modified":"2026-06-17T03:35:05.807Z","cvss":[{"version":"3.1","score":5.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"primary"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:N/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-400","CWE-835"],"updated_at":"2026-11-02T14:06:49.284888Z"}],"osv":[{"id":"CVE-2021-21235","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.","status":"published","published":"2021-01-06T02:15:12.967Z","modified":"2026-10-20T10:54:28.158422428Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:44:18.004149Z"},{"id":"GHSA-px9g-8hgv-jvg2","title":"kamadak-exif vulnerable to Infinite loop when parsing PNG files","description":"### 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* \u003chttps://github.com/kamadak/exif-rs/security/advisories/GHSA-px9g-8hgv-jvg2\u003e\n* \u003chttps://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21235\u003e\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)","status":"published","published":"2022-10-06T19:53:39Z","modified":"2026-07-08T06:27:46.767271337Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-400","CWE-835"],"updated_at":"2026-11-02T15:46:53.700556Z"},{"id":"RUSTSEC-2021-0143","title":"kamadak-exif DoS with untrusted PNG data","description":"Attacker crafted data can cause a infinite loop leading to DoS if used with untrusted data.","status":"published","published":"2021-01-04T12:00:00Z","modified":"2023-11-08T04:04:38.884291Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:53:39.492624Z"},{"id":"UBUNTU-CVE-2021-21235","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.","status":"published","published":"2021-01-06T02:15:00Z","modified":"2026-10-17T12:56:19.313798749Z","cvss":[{"version":"3.1","score":5.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","level":"medium"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:54:26.29421Z"}]}}
