Bug 1297435 (CVE-2015-8396)

Summary: CVE-2015-8396 gdcm: Buffer overflow in ImageRegionReader::ReadIntoBuffer
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: amaris, carnil, lemenkov, mrceresa, sanjay.ankur, sebp
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdcm 2.6.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-02 09:21:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1297436    
Bug Blocks:    

Description Adam Mariš 2016-01-11 14:10:06 UTC
It was found that GDCM versions 2.6.0 and 2.6.1 (and possibly previous versions) are prone to an integer overflow vulnerability which leads to a buffer overflow and potentially to remote code execution. The vulnerability is triggered by the exposed function gdcm::ImageRegionReader::ReadIntoBuffer, which copies DICOM image data to a buffer. ReadIntoBuffer checks whether the supplied buffer is large enough to hold the necessary data, however in this check it fails to detect the occurrence of an integer overflow, which leads to a buffer overflow later on in the code. The buffer overflow will occur regardless of the size of the buffer supplied to the ReadIntoBuffer call.

External reference:

http://census-labs.com/news/2016/01/11/gdcm-buffer-overflow-imageregionreaderreadintobuffer/

Comment 1 Adam Mariš 2016-01-11 14:10:45 UTC
Created gdcm tracking bugs for this issue:

Affects: fedora-all [bug 1297436]

Comment 2 Sebastian Pölsterl 2016-01-13 19:19:00 UTC
AFAICT, this affects the 2.6 series. GDCM in rawhide has been updated to 2.6.2, which includes the fix, already. The remaining Fedora versions only include gdcm-2.4.x, which are not affected?

Comment 3 Adam Mariš 2016-01-14 09:39:37 UTC
(In reply to Sebastian Pölsterl from comment #2)
> AFAICT, this affects the 2.6 series. GDCM in rawhide has been updated to
> 2.6.2, which includes the fix, already. The remaining Fedora versions only
> include gdcm-2.4.x, which are not affected?

Could you please explain why do you think so? The source code in 2.4.5 looks pretty much the same for given vulnerable functions.