Bug 1546858 (CVE-2018-7225)

Summary: CVE-2018-7225 libvncserver: Improper input sanitization in rfbProcessClientNormalMessage in rfbserver.c
Product: [Other] Security Response Reporter: Laura Pardo <lpardo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: negativo17, ppisar, rdieter
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-11 09:31:21 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: 1546859, 1546860, 1548440, 1548441    
Bug Blocks: 1546862    
Attachments:
Description Flags
Proposed fix
none
Proposed fix to mitigate excessive memory use none

Description Laura Pardo 2018-02-19 20:09:31 UTC
An issue was discovered in LibVNCServer through 0.9.11. rfbProcessClientNormalMessage() in rfbserver.c does not sanitize msg.cct.length, leading to access to uninitialized and potentially sensitive data or possibly unspecified other impact (e.g., an integer overflow) via specially crafted VNC packets.


References:
https://github.com/LibVNC/libvncserver/issues/218
http://www.openwall.com/lists/oss-security/2018/02/18/1

Comment 1 Laura Pardo 2018-02-19 20:10:00 UTC
Created libvncserver tracking bugs for this issue:

Affects: epel-7 [bug 1546859]
Affects: fedora-all [bug 1546860]

Comment 4 Petr Pisar 2018-02-26 13:39:02 UTC
Created attachment 1400842 [details]
Proposed fix

This prevents from the integer overflow.

However, it does not impose any length limit to prevent from allocating a lot of memory as I don't know what the sane limit should be.

Comment 5 Petr Pisar 2018-03-06 12:17:00 UTC
Created attachment 1404775 [details]
Proposed fix to mitigate excessive memory use

The original patch fixes only the use of noninicialized memory. This second patch prevents from a DoS when a client request a valid but really big buffer size (2 GB) by limiting the acceptable size to 1 MB.

Comment 7 Fedora Update System 2018-03-27 20:13:05 UTC
libvncserver-0.9.11-5.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2018-03-30 13:16:55 UTC
libvncserver-0.9.11-6.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2018-04-03 14:24:36 UTC
libvncserver-0.9.11-3.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 errata-xmlrpc 2018-04-10 09:10:12 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:1055 https://access.redhat.com/errata/RHSA-2018:1055