Bug 860991 (CVE-2014-0019) - VUL-1: CVE-2014-0019: socat: PROXY-CONNECT address overflow
Summary: VUL-1: CVE-2014-0019: socat: PROXY-CONNECT address overflow
Status: RESOLVED FIXED
Alias: CVE-2014-0019
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P4 - Low : Minor
Target Milestone: ---
Assignee: Marcus Meissner
QA Contact: Security Team bot
URL:
Whiteboard: CVSSv2:SUSE:CVE-2014-0019:1.5:(AV:L/A...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-29 07:34 UTC by Sebastian Krahmer
Modified: 2019-08-28 22:48 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Fix CVE-2014-0019 (1.58 KB, patch)
2016-02-04 09:18 UTC, Peter Simons
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Krahmer 2014-01-29 07:34:50 UTC
Via OSS-sec:

Socat security advisory 5 - PROXY-CONNECT address overflow

Overview
  socats PROXY-CONNECT address is vulnerable to a buffer overflow with
  data from command line

Vulnerability Id: CVE-2014-0019

Serverity: Low

Details
  Due to a missing check during assembly of the HTTP request line a
  long target server name (<hostname> in the documentation) in
  the PROXY-CONNECT address can cause a stack buffer overrun.
  Exploitation requires that the attacker is able to provide the
  target server name to the PROXY-CONNECT address in the command
  line. This can happen for example in scripts that receive data
  from untrusted sources.

Testcase
  This overflow can not always be reliably reproduced. It may be helpful
  to build socat with gcc option -Wp,-D_FORTIFY_SOURCE=2 or to run socat
  under ElectricFence or another memory checker.

  In one terminal run a dummy server because socat first needs to
  establish a connection:

    socat tcp-l:8080,reuseaddr /dev/null

  In a second terminal run the check:

    socat - PROXY-CONNECT:localhost:$(perl -e "print 'A' x
384"):1,proxyport=8080

  If this command terminates with Segmentation Violation, with a
  buffer overflow message or similar, your version of socat is
  vulnerable.

  However, a Connection refused message does not necessarily mean that your
  version is not vulnerable!

Affected versions
  1.3.0.0 - 1.7.2.2
  2.0.0-b1 - 2.0.0-b6

Not affected or corrected versions
  1.0.0.0 - 1.2.0.0
  1.7.2.3 and later
  2.0.0-b7 and later
Workaround
  Truncate the target server name to a length of 256 characters before
  passing it to socats command line

Download
  The updated sources can be downloaded from:

    http://www.dest-unreach.org/socat/download/socat-1.7.2.3.tar.gz
    http://www.dest-unreach.org/socat/download/socat-2.0.0-b7.tar.gz

  Patch to 1.7.2.2:
    http://www.dest-unreach.org/socat/download/socat-1.7.2.3.patch.gz

  Patch to 2.0.0-b6:
    http://www.dest-unreach.org/socat/download/socat-2.0.0-b7.patch.gz

Credits
   Credits to Florian Weimer of the Red Hat Product Security Team
Comment 1 Sebastian Krahmer 2014-01-29 09:52:27 UTC
overflow on the commandline -> VUL-1
Comment 2 Andreas Stieger 2015-04-16 08:17:45 UTC
Rudy, I am reviewing your submission
https://build.opensuse.org/request/show/296733
A reference to this bug is missing there.
Comment 3 Swamp Workflow Management 2015-04-24 08:05:03 UTC
openSUSE-SU-2015:0760-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 860991,927161
CVE References: CVE-2014-0019
Sources used:
openSUSE 13.1 (src):    socat-1.7.2.4-2.3.1
Comment 4 Peter Simons 2016-02-04 08:48:39 UTC
This issue is fixed by commit 7a348bdfd56f9fbb761b1387698b22b2d0d7f620. The patch also updates the test.sh script included in the distribution, which is helpful to verify that the issue is gone.
Comment 5 Peter Simons 2016-02-04 09:18:23 UTC
Created attachment 664421 [details]
Fix CVE-2014-0019

Minimal patch extracted from upstream commit 7a348bdfd56f9fbb761b1387698b22b2d0d7f620.
Comment 7 Swamp Workflow Management 2016-02-05 12:12:21 UTC
SUSE-SU-2016:0343-1: An update that solves two vulnerabilities and has one errata is now available.

Category: security (moderate)
Bug References: 821985,860991,964844
CVE References: CVE-2013-3571,CVE-2014-0019
Sources used:
SUSE Linux Enterprise Server 11-SP4 (src):    socat-1.7.0.0-1.18.2
SUSE Linux Enterprise Desktop 11-SP4 (src):    socat-1.7.0.0-1.18.2
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    socat-1.7.0.0-1.18.2
Comment 8 Marcus Meissner 2016-02-05 12:22:39 UTC
released