ASA-2018-00020 – curl: warning message out-of-bounds read


Allele Security Alert

ASA-2018-00020

Identifier(s)

ASA-2018-00020, CVE-2018-16842

Title

warning message out-of-bounds read

Vendor(s)

the Curl project

Product(s)

curl

Affected version(s)

curl 7.14.1 to and including 7.61.1

Fixed version(s)

curl >= 7.62.0

Proof of concept

Unknown

Description

curl contains a heap out-of-bounds read vulnerability.

The command line tool has a generic function for displaying warning and informational messages to stderr for various situations. For example if an unknown command line argument is used, or passed to it in a “config” file.

This display function formats the output to wrap at 80 columns. The wrap logic is however flawed, so if a single word in the message is itself longer than 80 bytes the buffer arithmetic calculates the remainder wrong and will end up reading behind the end of the buffer. This could lead to information disclosure or crash.

This vulnerability could lead to a security issue if used in this or similar situations:

  1. a server somewhere uses the curl command line to run something if it fails,
  2. it shows stderr to the user
  3. the server takes user input for parts of its command line input
  4. user provides something overly long that triggers this crash
  5. the stderr output may now contain user memory contents that wasn’t meant to be available

Technical details

Unknown

Credits

Brian Carpenter (Geeknik Labs)

Reference(s)

CURL 7.62.0 MOAR STUFF
https://daniel.haxx.se/blog/2018/10/31/curl-7-62-0-moar-stuff/

warning message out-of-buffer read
https://curl.haxx.se/docs/CVE-2018-16842.html

Added more verbose “warning” messages to the curl client for cases
https://github.com/curl/curl/commit/d9ca9154d1

voutf: fix bad arethmetic when outputting warnings to stderr
https://github.com/curl/curl/commit/d530e92f59ae9bb2d47066c3c460b25d2ffeb211

CVE-2018-16842
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16842

CVE-2018-16842
https://nvd.nist.gov/vuln/detail/CVE-2018-16842

If there is any error in this alert or you wish a comprehensive analysis, let us know.

Last modified: February 6, 2019

We are not responsible for any data loss, device corruption or any other type of issue due to the use of any information mentioned in our security alerts.