curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

[SECURITY ADVISORY] curl: TLS and SSH connection too eager reuse

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 11 May 2022 08:41:12 +0200 (CEST)

TLS and SSH connection too eager reuse
======================================

Project curl Security Advisory, May 11 2022 -
[Permalink](https://curl.se/docs/CVE-2022-27782.html)

VULNERABILITY
-------------

libcurl would reuse a previously created connection even when a TLS or SSH
related option had been changed that should have prohibited reuse.

libcurl keeps previously used connections in a connection pool for subsequent
transfers to reuse if one of them matches the setup. However, several TLS and
SSH settings were left out from the configuration match checks, making them
match too easily.

We are not aware of any exploit of this flaw.

INFO
----
Here are the list of options that were not considered in the check, so curl
would reuse a connection even if the subsequent transfer would have changed
one or more of these options.
### TLS options
- `CURLOPT_SSL_OPTIONS` (since 7.25.0)
- `CURLOPT_CRLFILE` (since 7.19.0)
- `CURLOPT_TLSAUTH_USERNAME` (since 7.21.4)
- `CURLOPT_TLSAUTH_PASSWORD` (since 7.21.4)
- `CURLOPT_PROXY_SSL_OPTIONS` (since 7.52.0)
- `CURLOPT_PROXY_CRLFILE` (since 7.52.0)
- `CURLOPT_PROXY_TLSAUTH_USERNAME` (since 7.52.0)
- `CURLOPT_PROXY_TLSAUTH_PASSWORD` (since 7.52.0)
### SSH options
- `CURLOPT_SSH_PUBLIC_KEYFILE` (since 7.16.1)
- `CURLOPT_SSH_PRIVATE_KEYFILE` (since 7.16.1)
This flaw was initially introduced in curl 7.16.1 and has been widened several
times since then. See table above for details
The Common Vulnerabilities and Exposures (CVE) project has assigned the name
CVE-2022-27782 to this issue.
CWE-305: Authentication Bypass by Primary Weakness
Severity: Medium
AFFECTED VERSIONS
-----------------
- Affected versions: curl 7.16.1 to and including 7.83.0
- Not affected versions: curl < 7.16.1 and curl >= 7.83.1
libcurl is used by many applications, but not always advertised as such!
THE SOLUTION
------------
The two patches for CVE-2022-27782: [TLS-fix](https://github.com/curl/curl/commit/f18af4f874) and [SSH-fix](https://github.com/curl/curl/commit/1645e9b44505abd5cbaf65da5282c3f33b5924a5)
RECOMMENDATIONS
--------------
  A - Upgrade curl to version 7.83.1
  B - Apply the patch to your local version
TIMELINE
--------
This issue was reported to the curl project on May 1, 2022. We contacted
distros_at_openwall on May 5.
libcurl 7.83.1 was released on May 11 2022, coordinated with the publication
of this advisory.
CREDITS
-------
This issue was reported by Harry Sintonen. Patched by Daniel Stenberg.
Thanks a lot!
-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-05-11