CVE-2016-5421: Use After Free

Published Aug 1, 2016
·
Updated

A use-after-free vulnerability in libcurl was found. libcurl works with easy handles using the type 'CURL ' that are objects the application creates using curleasyinit(). They are the handles that are all each associated with a single transfer at a time. libcurl also has an internal struct that represents and holds most state that is related to a single connection. An easy handle can hold references to one or many such connection structs depending on the requested operations.

When using libcurl's multi interface, an application performs transfers by adding one or more easy handles to the multi handle and then it can drive all those transfers in parallel.

Due to a flaw, libcurl could leave a pointer to a freed connection struct dangling in an easy handle that was previously added to a multi handle when curlmulticleanup() is called with an easy handle still added to it. This does not seem to cause any notable harm if the handle is then closed properly.

However, if the easy handle would instead get used again with the easy interface and curleasyperform() to do another transfer, it would blindly use the connection struct pointer now pointing to freed memory.

An application could be made to allocate its own fake version of the connect struct, fill in some data and then have the curleasyperform() call do something that clearly was not intended by the original code.

External Reference:

https://curl.haxx.se/docs/adv20160803C.html

Other sources

Use-after-free vulnerability in libcurl before 7.50.1 allows attackers to control which connection is used or possibly have unspecified other impact via unknown vectors.

MITRE

Affected Software

11 affected componentsFixes available
redhat/curl<7.50.1
7.50.1
Google Android
openSUSE Leap=42.1
haxx libcurl<=7.50.0
Canonical Ubuntu Linux=12.04
Canonical Ubuntu Linux=14.04
Canonical Ubuntu Linux=16.04
Debian Debian Linux=8.0
Fedoraproject Fedora=23
Fedoraproject Fedora=24
openSUSE openSUSE=13.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/curl to a version that resolves this vulnerability.

    Fixed in 7.50.1
  2. Upgrade

    Upgrade libcurl to a version that resolves this vulnerability.

    Fixed in 7.50.1
  3. Operational

    When using libcurl’s multi interface, ensure an easy handle is no longer added to a multi handle before calling curl_multi_cleanup(); do not reuse an easy handle with curl_easy_perform() after curl_multi_cleanup() has been called while the easy handle is still added to the multi handle.

Event History

Aug 1, 2016
Data Sourced
via Red Hat·01:51 PM
DescriptionSeverityAffected Software
Aug 10, 2016
CVE Published
via MITRE·02:00 PM
Data Sourced
via MITRE·02:00 PM
Description
Dec 5, 2016
Data Sourced
via Android·12:00 AM
SeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2016-5421?

CVE-2016-5421 has a high severity rating due to its potential for attackers to manipulate connections and cause unspecified impacts.

2

How do I fix CVE-2016-5421?

To fix CVE-2016-5421, update libcurl to version 7.50.1 or later.

3

Which versions are affected by CVE-2016-5421?

CVE-2016-5421 affects libcurl versions prior to 7.50.1, along with various Linux distributions using older versions.

4

Can CVE-2016-5421 be exploited remotely?

Yes, CVE-2016-5421 can be exploited remotely through crafted requests that leverage the vulnerability.

5

What software is impacted by CVE-2016-5421?

CVE-2016-5421 impacts software using affected versions of libcurl, including certain distributions like Ubuntu, Debian, Fedora, and openSUSE.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203