/ | Mailing list | Docs | Examples | GitHub
libssh2 Security Advisory: CVE-2019-3857

Possible integer overflow leading to zero-byte allocation and out-of-bounds write

Project libssh2 Security Advisory, March 18 2019 - Permalink

VULNERABILITY

A server could send a SSH_MSG_CHANNEL_REQUEST packet with an exit signal message with a length of max unsigned integer value. The length would then have a value of 1 added to it and used to allocate memory causing a possible memory write out of bounds error or zero byte allocation (CWE-130).

There are no known exploits of this flaw at this time.

INFO

The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2019-3857 to this issue.

AFFECTED VERSIONS

THE SOLUTION

libssh2 1.8.1 ensures the length of the message plus 1 is less than UINT_MAX before allocating memory using the computed value.

A patch for this problem is available

RECOMMENDATIONS

We suggest you take one of the following actions immediately, in order of preference:

A - Upgrade to libssh2 1.8.1 or later

B - Apply the patch and rebuild libssh2

TIME LINE

It was first reported to the libssh2 project on Dec 3 2018 by Chris Coulson.

libssh2 1.8.1 was released on March 18, coordinated with the publication of this advisory.

CREDITS

Reported by Chris Coulson of Canonical Ltd.