Every CVE Search/ Get API key

CVE-2021-21235

Infinite loop in parsing PNG files in

5.7 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
Required

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

1.53%Up 0.7 points since Apr 14, 2021
90%50%10%1%

What each source reports

CVE List Score used 5.7

Infinite loop in parsing PNG files in

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.

Record
CVE-2021-21235
CVSS 3.1
5.7 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
EUVDEUVD-2022-7148 5.7

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.

Record
EUVD-2022-7148
CVSS 3.1
5.7 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-px9g-8hgv-jvg2 6.5

kamadak-exif vulnerable to Infinite loop when parsing PNG files

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

For more information

If you have any questions or comments about this advisory:

Record
GHSA-px9g-8hgv-jvg2
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-835
Updated
2026-11-02
NVD 5.7

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.

Record
CVE-2021-21235
CVSS 3.1
5.7 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
CVSS 2.0
4.3 MediumAV:N/AC:M/Au:N/C:N/I:N/A:P
Weakness
CWE-400, CWE-835
Updated
2026-11-02
OSV 6.5

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.

Record
CVE-2021-21235
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVGHSA-px9g-8hgv-jvg2 6.5

kamadak-exif vulnerable to Infinite loop when parsing PNG files

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

For more information

If you have any questions or comments about this advisory:

Record
GHSA-px9g-8hgv-jvg2
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-400, CWE-835
Updated
2026-11-02
OSVRUSTSEC-2021-0143 6.5

kamadak-exif DoS with untrusted PNG data

Attacker crafted data can cause a infinite loop leading to DoS if used with untrusted data.

Record
RUSTSEC-2021-0143
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2021-21235 5.7

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.

Record
UBUNTU-CVE-2021-21235
CVSS 3.1
5.7 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
kamadak-exif
crates.io
0.5.2 to 0.5.2
0.5.3
kamadak-exif
crates.io
0.5.2 up to 0.5.3
0.5.3
rust-kamadak-exif
Ubuntu:20.04:LTS
All versions, plus listed versions
0.3.1-2
None known
rust-kamadak-exif
Ubuntu:22.04:LTS
All versions, plus listed versions
0.3.1-2
None known
rust-kamadak-exif
Ubuntu:24.04:LTS
All versions, plus listed versions
0.5.5-1
None known
rust-kamadak-exif
Ubuntu:25.10
All versions, plus listed versions
0.5.5-1
None known
rust-kamadak-exif
Ubuntu:26.10
All versions, plus listed versions
0.6.1-1
None known
rust-kamadak-exif
Ubuntu:26.04:LTS
All versions, plus listed versions
0.5.5-10.6.1-1
None known

History

History
RecordedChangedSources
facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-21235 is a medium vulnerability (CVSS 5.7) in Kamadak-exif Project Kamadak-exif, published January 4, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.53%, the 75th percentile. Fixed in kamadak-exif 0.5.3.

References

Show 4 moreShow less
MoveEnter Open