Blog
Vulnerabilities and Threats

How Serious Is The Curl [CVE-2023-38545] Vulnerability?

Benjamin Marr
Author
Benjamin Marr
Security Engineer

Key Points

Our take: patch the curl vulnerability (CVE-2023-38545) according to your normal schedule, but only move to panic stations if you use curl in proxy-resolver mode via a SOCKS5 proxy, it's a vulnerable version, and there is a clear path for attackers to control which server curl is pointing at, e.g. with untrusted user inputs on a public application.

What is the curl vulnerability?

The curl vulnerability is a heap-based buffer overflow within hostnames of SOCKS5 proxies via the command-line flag. This happens due to curl switching to a local resolve mode if the name is too long. However, there are some caveats/requirements to make exploitation possible:

  • The attacker must be able to point curl at a malicious server they control
  • curl must be using a SOCKS5 proxy using proxy-resolver mode
  • curl must be configured to automatically follow redirects
  • An overflow is only possible in applications that do not set CURLOPT_BUFFERSIZE when using libcurl, or set it smaller than 65541. Since curl sets CURLOPT_BUFFERSIZE to 100kB by default it is not vulnerable in its default state
  • The SOCKS5 handshake to trigger the local variable bug needs to be "slow enough" to trigger the local variable bug. This is not defined, however they do state "typical server latency is likely slow enough"

Due to these caveats, modern memory protections available, and the fact that attackers must first find attack surface which exposes curl in a vulnerable manner, we do not believe that there will be wide-spread mass exploitation.

This vulnerability is likely to be a bigger problem for security devices and other appliances which fetch untrusted content using curl under the hood. curl is also available on every Linux OS so it may be used as a new path for privilege escalation in certain attack chains, if an attacker can find curl being used in any root context.

Affected software

The maintainers of curl have disclosed two vulnerabilities in libcurl which affect versions 7.69.0 up to and including 8.3.0.  One of these is rated as High severity and was initially described by the maintainers as "probably the worst curl security flaw in a long time". curl is a command-line tool that many applications rely on for their functionality. The maintainers keep a list of some companies that use curl in their products. This High severity vulnerability impacts both curl and libcurl and patches are now available from the curl site or from your chose Linux distro.

How to identify the curl vulnerability

To identify which versions of curl you have installed (either standalone or packed within other applications) we have collated some methods to assist with this. The affected versions are between 7.69.0 to and including 8.3.0.

Below are examples of how to identify curl binaries on your systems.

Linux / MacOS

Windows

  • Remember to update the drive letter if you want to search a different drive than C:\

Using Defender for Endpoints

KQL queries

Docker containers, JFog Artifactory, or AWS Elastic Container Registry using Docker Scout

  • Source and further information by Docker available here.

How to fix the curl vulnerability

Apply the latest patch. If the version of curl (or libcurl) installed is packaged within an application install, please seek guidance on patching this software from the relevant vendor.

How to defend against exploitation

Patching as soon as possible is recommended for organizations that use curl in proxy-resolver mode via a SOCKS5 proxy, or use cases where there is a clear path for attackers to control which server curl is pointing at, e.g. with untrusted user inputs on a public application. For general patching outside of these use cases, we recommend implementing the latest patches according to your usual schedule for High impact weaknesses. Where a patch isn't available for the target system/application, we recommend monitoring the use of SOCKS5 proxies by curl/libcurl.

How to identify exploitation

The following flags for curl should be monitored for excessive large strings:

The following options for libcurl are affected (environment variables):

References

How Intruder is helping

We're currently monitoring the situation and will update this post as we find out more. For those customers who have internal targets added to the portal, please run a fresh scan to ensure that you are checked for the curl security vulnerability.

If there is further fallout, our security team will conduct Rapid Response for our Premium and Vanguard customers for this vulnerability where it affects other downstream software/hardware.

Get our free

Ultimate Guide to Vulnerability Scanning

Learn everything you need to get started with vulnerability scanning and how to get the most out of your chosen product with our free PDF guide.

Sign up for your free 14-day trial

7 days free trial
Intruder's security expert explains what the curl vulnerability is, whether you should be concerned about it, and how to identify and fix it.
back to BLOG

How Serious Is The Curl [CVE-2023-38545] Vulnerability?

Benjamin Marr

Our take: patch the curl vulnerability (CVE-2023-38545) according to your normal schedule, but only move to panic stations if you use curl in proxy-resolver mode via a SOCKS5 proxy, it's a vulnerable version, and there is a clear path for attackers to control which server curl is pointing at, e.g. with untrusted user inputs on a public application.

What is the curl vulnerability?

The curl vulnerability is a heap-based buffer overflow within hostnames of SOCKS5 proxies via the command-line flag. This happens due to curl switching to a local resolve mode if the name is too long. However, there are some caveats/requirements to make exploitation possible:

  • The attacker must be able to point curl at a malicious server they control
  • curl must be using a SOCKS5 proxy using proxy-resolver mode
  • curl must be configured to automatically follow redirects
  • An overflow is only possible in applications that do not set CURLOPT_BUFFERSIZE when using libcurl, or set it smaller than 65541. Since curl sets CURLOPT_BUFFERSIZE to 100kB by default it is not vulnerable in its default state
  • The SOCKS5 handshake to trigger the local variable bug needs to be "slow enough" to trigger the local variable bug. This is not defined, however they do state "typical server latency is likely slow enough"

Due to these caveats, modern memory protections available, and the fact that attackers must first find attack surface which exposes curl in a vulnerable manner, we do not believe that there will be wide-spread mass exploitation.

This vulnerability is likely to be a bigger problem for security devices and other appliances which fetch untrusted content using curl under the hood. curl is also available on every Linux OS so it may be used as a new path for privilege escalation in certain attack chains, if an attacker can find curl being used in any root context.

Affected software

The maintainers of curl have disclosed two vulnerabilities in libcurl which affect versions 7.69.0 up to and including 8.3.0.  One of these is rated as High severity and was initially described by the maintainers as "probably the worst curl security flaw in a long time". curl is a command-line tool that many applications rely on for their functionality. The maintainers keep a list of some companies that use curl in their products. This High severity vulnerability impacts both curl and libcurl and patches are now available from the curl site or from your chose Linux distro.

How to identify the curl vulnerability

To identify which versions of curl you have installed (either standalone or packed within other applications) we have collated some methods to assist with this. The affected versions are between 7.69.0 to and including 8.3.0.

Below are examples of how to identify curl binaries on your systems.

Linux / MacOS

Windows

  • Remember to update the drive letter if you want to search a different drive than C:\

Using Defender for Endpoints

KQL queries

Docker containers, JFog Artifactory, or AWS Elastic Container Registry using Docker Scout

  • Source and further information by Docker available here.

How to fix the curl vulnerability

Apply the latest patch. If the version of curl (or libcurl) installed is packaged within an application install, please seek guidance on patching this software from the relevant vendor.

How to defend against exploitation

Patching as soon as possible is recommended for organizations that use curl in proxy-resolver mode via a SOCKS5 proxy, or use cases where there is a clear path for attackers to control which server curl is pointing at, e.g. with untrusted user inputs on a public application. For general patching outside of these use cases, we recommend implementing the latest patches according to your usual schedule for High impact weaknesses. Where a patch isn't available for the target system/application, we recommend monitoring the use of SOCKS5 proxies by curl/libcurl.

How to identify exploitation

The following flags for curl should be monitored for excessive large strings:

The following options for libcurl are affected (environment variables):

References

How Intruder is helping

We're currently monitoring the situation and will update this post as we find out more. For those customers who have internal targets added to the portal, please run a fresh scan to ensure that you are checked for the curl security vulnerability.

If there is further fallout, our security team will conduct Rapid Response for our Premium and Vanguard customers for this vulnerability where it affects other downstream software/hardware.

Release Date
Level of Ideal
Comments
Before CVE details are published
🥳
Limited public information is available about the vulnerability.

Red teamers, security researchers, detection engineers, threat actors have to actively research type of vulnerability, location in vulnerable software and build an associated exploit.

Tenable release checks for 47.43% of the CVEs they cover in this window, and Greenbone release 32.96%.
Day of CVE publish
😊
Vulnerability information is publicly accessible.

Red teamers, security researchers, detection engineers and threat actors now have access to some of the information they were previously having to hunt themselves, speeding up potential exploit creation.

Tenable release checks for 17.12% of the CVEs they cover in this window, and Greenbone release 17.69%.
First week since CVE publish
😐
Vulnerability information has been publicly available for up to 1 week.

The likelihood that exploitation in the wild is going to be happening is steadily increasing.

Tenable release checks for 10.9% of the CVEs they cover in this window, and Greenbone release 20.69%.
Between 1 week and 1 month since CVE publish
🥺
Vulnerability information has been publicly available for up to 1 month, and some very clever people have had time to craft an exploit.

We’re starting to lose some of the benefit of rapid, automated vulnerability detection.

Tenable release checks for 9.58% of the CVEs they cover in this window, and Greenbone release 12.43%.
After 1 month since CVE publish
😨
Information has been publicly available for more than 31 days.

Any detection released a month after the details are publicly available is decreasing in value for me.

Tenable release checks for 14.97% of the CVEs they cover over a month after the CVE details have been published, and Greenbone release 16.23%.

With this information in mind, I wanted to check what is the delay for both Tenable and Greenbone to release a detection for their scanners. The following section will focus on vulnerabilities which:

  • Have CVSSv2 rating of 10
  • Are exploitable over the network
  • Require no user interaction

These are the ones where an attacker can point their exploit code at your vulnerable system and gain unauthorised access.

We’ve seen previously that Tenable have remote checks for 643 critical vulnerabilities, and OpenVAS have remote checks for 450 critical vulnerabilities. Tenable release remote checks for critical vulnerabilities within 1 month of the details being made public 58.4% of the time, but Greenbone release their checks within 1 month 76.8% of the time. So, even though OpenVAS has fewer checks for those critical vulnerabilities, you are more likely to get them within 1 month of the details being made public. Let’s break that down further.

In Figure 10 we can see the absolute number of remote checks released on a given day after a CVE for a critical vulnerability has been published. What you can immediately see is that both Tenable and OpenVAS release the majority of their checks on or before the CVE details are made public; Tenable have released checks for 247 CVEs, and OpenVAS have released checks for 144 CVEs. Then since 2010 Tenable have remote released checks for 147 critical CVEs and OpenVAS 79 critical CVEs on the same day as the vulnerability details were published. The number of vulnerabilities then drops off across the first week and drops further after 1 week, as we would hope for in an efficient time-to-release scenario.

Figure 10: Absolute numbers of critical CVEs with a remote check release date from the date a CVE is published

While raw numbers are good, Tenable have a larger number of checks available so it could be unfair to go on raw numbers alone. It’s potentially more important to understand the likelihood that OpenVAS or Tenable will release a check of a vulnerability on any given day after a CVE for a critical vulnerability is released. In Figure 11 we can see that Tenable release 61% their checks on or before the date that a CVE is published, and OpenVAS release a shade under 50% of their checks on or before the day that a CVE is published.

Figure 11: Percentage chance of delay for critical vulnerabilities

So, since 2010 Tenable has more frequently released their checks before or on the same day as the CVE details have been published for critical vulnerabilities. While Tenable is leading at this point, Greenbone’s community feed still gets a considerable percentage of their checks out on or before day 0.

I thought I’d go another step further and try and see if I could identify any trend in each organisations release delay, are they getting better year-on-year or are their releases getting later? In Figure 12 I’ve taken the mean delay for critical vulnerabilities per year and plotted them. The mean as a metric is particularly influenced by outliers in a data set, so I expected some wackiness and limited the mean to only checks released 180 days prior to a CVE being published and 31 days after a CVE being published. These seem to me like reasonable limits, as anything greater than 6 months prior to CVE details being released is potentially a quirk of the check details and anything after a 1-month delay is less important for us.

What can we take away from Figure 12?

  • We can see that between 2011 and 2014 Greenbone’s release delay was better than that of Tenable, by between 5 and 10 days.
  • In 2015 things reverse and for 3 years Tenable is considerably ahead of Greenbone by a matter of weeks.
  • But, then in 2019 things get much closer and Greenbone seem to be releasing on average about a day earlier than Tenable.
  • For both the trendline over an 11-year period is very close, with Tenable marginally beating Greenbone.
  • We have yet to have any data for 2021 for OpenVAS checks for critical show-stopper CVEs.
Figure 12: Release delay year-on-year (lower is better)

With the larger number of checks, and still being able to release a greater percentage of their remote checks for critical vulnerabilities Tenable could win this category. However, the delay time from 2019 and 2020 going to OpenVAS, and the trend lines being so close, I am going to declare this one a tie. It’s a tie.

The takeaway from this is that both vendors are getting their checks out the majority of the time either before the CVE details are published or on the day the details are published. This is overwhelmingly positive for both scanning solutions. Over time both also appear to be releasing remote checks for critical vulnerabilities more quickly.

Written by

Benjamin Marr

Recommended articles

Ready to get started with your 14-day trial?
try for free