CVE-2020-14382: High severity cryptsetup vulnerability
A vulnerability was found in upstream release cryptsetup-2.2.0 where, there's a bug in LUKS2 format validation code, that is effectively invoked on every device/image presenting itself as LUKS2 container. The bug is in segments validation code in file 'lib/luks2/luks2jsonmetadata.c' in function hdrvalidatesegments(struct cryptdevice cd, jsonobject hdrjobj) where the code does not check for possible overflow on memory allocation used for intervals array (see statement "intervals = malloc(firstbackup sizeof(intervals));"). Due to the bug, library can be tricked to expect such allocation was successful but for far less memory then originally expected. Later it may read data FROM image crafted by an attacker and actually write such data BEYOND allocated memory.
Other sources
As per the reporter:
There's a bug in LUKS2 format validation code, that is effectively invoked on every device/image presenting itself as LUKS2 container. The bug is in segments validation code in file 'lib/luks2/luks2jsonmetadata.c' in function hdrvalidatesegments(struct cryptdevice cd, jsonobject hdrjobj) where the code does not check for possible overflow on memory allocation used for intervals array (see statement "intervals = malloc(firstbackup sizeof(intervals));"). Due to the bug, library can be tricked to expect such allocation was successful but for far less memory then originally expected. Later it may read data FROM image crafted by an attacker and actually write such data BEYOND allocated memory!
Reference: https://bugzilla.redhat.com/showbug.cgi?id=1872294 Upstream commit: https://gitlab.com/cryptsetup/cryptsetup/-/commit/52f5cb8cedf22fb3e14c744814ec8af7614146c7
— Red Hat
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the vulnerability ID of this vulnerability?
The vulnerability ID of this vulnerability is CVE-2020-14382.
What is the severity of CVE-2020-14382?
CVE-2020-14382 has a severity of 7.8 (High).
What software versions are affected by CVE-2020-14382?
CVE-2020-14382 affects cryptsetup versions up to but excluding 2.3.4.
How can I fix CVE-2020-14382?
To fix CVE-2020-14382, you need to update cryptsetup to version 2.3.4.
Where can I find more information about CVE-2020-14382?
More information about CVE-2020-14382 can be found at the following references: [link1], [link2], [link3].