CVE-2024-45620: Libopensc: incorrect handling of the length of buffers or files in pkcs15init
A vulnerability was found in the pkcs15-init tool in OpenSC. An attacker could use a crafted USB Device or Smart Card, which would present the system with a specially crafted response to APDUs. When buffers are partially filled with data, initialized parts of the buffer can be incorrectly accessed.
Other sources
The reported issues are part of the card enrollment process using the pkcs15-init tool. The attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs, so they are considered high complexity and low severity.
When buffers are partially filled with data, uninitialized parts of the buffer can be incorrectly accessed. The uninitialized variables were reflected in the following functions:
- starcoswritepukey - iaseccsdoparse - setcosgeneratekey - schsmdeterminefreeid
Originally reported by Matteo Marini (Sapienza University of Rome)
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/openscto a version that resolves this vulnerability.Fixed in 0.21.0-1+deb11u1Fixed in 0.23.0-0.3+deb12u2Fixed in 0.26.1-1
Event History
Frequently Asked Questions
What is the severity of CVE-2024-45620?
CVE-2024-45620 has been assigned a high severity rating due to its potential for exploitation via crafted USB devices or smart cards.
How do I fix CVE-2024-45620?
To mitigate CVE-2024-45620, update to the latest version of OpenSC or the Red Hat Enterprise Linux distributions that address the vulnerability.
What versions are affected by CVE-2024-45620?
CVE-2024-45620 affects Red Hat Enterprise Linux versions 7.0, 8.0, and 9.0, and OpenSC versions prior to 0.26.0.
What type of attack is associated with CVE-2024-45620?
CVE-2024-45620 is associated with attacks utilizing crafted USB devices or smart cards that can manipulate buffer handling.
Is there a workaround for CVE-2024-45620?
Currently, the best practice for CVE-2024-45620 is to apply recommended patches and updates from Red Hat or OpenSC as soon as possible.