Bug 1098479 (CVE-2014-0749)

Summary: CVE-2014-0749 torque: buffer overflow exists in versions of TORQUE which can be exploited in order to remotely execute code from an unauthenticated perspective
Product: [Other] Security Response Reporter: Vasyl Kaigorodov <vkaigoro>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: carnil, extras-orphan, fotis, garrick
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-22 02:06:14 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: 1098583, 1098584    
Bug Blocks:    

Description Vasyl Kaigorodov 2014-05-16 10:28:07 UTC
Upstream published [1] vulnerability description, which allow remote un-authenticated attacker to execute arbitrary commands with root privileges.
This issue is exploitable in all versions of the 2.5 branch, up to and including 2.5.13.
A patch is submitted to the 2.5-dev GitHub repository (which is still active) which resolves this issue.
It is strongly recommended that a version of 2.5-dev (later than pull request 171) is updated to.

The vulnerability exists because the file disrsi_.c fails to ensure that the length of count (which is read from the request packet) is less than dis_umaxd prior to being used in a later memcpy(). As a result a specially crafted request can smuggle through a count value which is later decremented and becomes the ct value in a memcpy() made from within tcp_gets():

memcpy((char *)str, tp->tdis_leadp, ct);

This failure to validate count allows control over the size of the memcpy() to be leveraged and as a result control over the amount of data read from the remainder of the packet. If this value is large the memcpy() will overwrite the stack and so can be leveraged in order to gain control over the execution of the program.
More details can be found at [1] and [2]

References:
  [1]: http://www.securityfocus.com/archive/1/532110
  [2]: https://labs.mwrinfosecurity.com/system/assets/662/original/torque-buffer-overflow_2014-05-14.pdf