ARD - CVE-2023-38545 & CVE-2023-38546 Curl Vulnerabilites
search cancel

ARD - CVE-2023-38545 & CVE-2023-38546 Curl Vulnerabilites

book

Article ID: 274879

calendar_today

Updated On:

Products

CA Agile Requirements Designer

Issue/Introduction

CVE-2023-38545 SOCKS5 heap buffer overflow

A heap-based buffer overflow flaw in the SOCKS5 proxy handshake of the Curl package that could lead to arbitrary remote code execution when using SOCKS5 proxies to access untrusted web servers.

  • Severity: High
  • Affected versions: Curl and libcurl from 7.69.0 up to and including 8.3.0.
  • Description: This flaw makes curl overflow a heap based buffer in the SOCKS5 proxy handshake.

    When curl is asked to pass along the hostname to the SOCKS5 proxy to allow that to resolve the address instead of it getting done by curl itself, the maximum length that hostname can be is 255 bytes.

    If the hostname is detected to be longer than 255 bytes, curl switches to local name resolving and instead passes on the resolved address only to the proxy. Due to a bug, the local variable that means "let the host resolve the name" could get the wrong value during a slow SOCKS5 handshake, and contrary to the intention, copy the too long hostname to the target buffer instead of copying just the resolved address there.

 

CVE-2023-38546 Cookie injection with none file

It is a low severity vulnerability that only impacts libcurl – a library provided by the Curl project that allows developers to access Curl APIs from their own code. 

  • Severity: Low
  • Affected versions: libcurl from 7.9.1 up to and including 8.3.0.
  • Description: This flaw allows an attacker to insert cookies at will into a running program using libcurl, if the specific series of conditions are met.

    libcurl performs transfers. In its API, an application creates "easy handles" that are the individual handles for single transfers.
    libcurl provides a function call that duplicates an easy handle called curl_easy_duphandle.

    If a transfer has cookies enabled when the handle is duplicated, the cookie-enable state is also cloned - but without cloning the actual cookies. If the source handle did not read any cookies from a specific file on disk, the cloned version of the handle would instead store the file name as none (using the four ASCII letters, no quotes).

    Subsequent use of the cloned handle that does not explicitly set a source to load cookies from would then inadvertently load cookies from a file named none - if such a file exists and is readable in the current directory of the program using libcurl. And if using the correct file format of course.

Environment

ARD Hub 3.3 and older

Cause

This is a third-party vulnerability.

CVE-2023-38545 (SOCKS5 heap buffer overflow):

  • The ARD Studio 3.x is not affected. We do not bundle curl, and we are not invoking it in the host system.
  • The ARD Hub 3.3 and older is impacted:
    • For the manual (non-dockerized) installation of ARD Hub, curl is not used, even though it may exist in the host operating system. As part of the OS maintenance, the customer may update curl in their system to the latest available version.

    • For the dockerized installation, there is a copy of curl in the docker image, and its version falls in the affected range. But the vulnerability can be exploited only when the attacker has sufficient access to the system in order to initiate a call to curl with specifically designed parameters, which possibility we assess as very low because of permissions. Nevertheless, we are now checking how to update curl in the docker image, or how to block even the theoretical possibility to exploit it. 

 

CVE-2023-38546 (Cookie injection with none file):

ARD Studio and ARD Hub are not impacted by this since we do not have this component in our images.

Resolution

This has been is completely addressed in ARD Hub 3.4. Broadcom highly recommends upgrading to the latest version once it is available.

For ARD customers who are using docker 3.3 or older versions, as a workaround, they can do the following steps to mitigate this specific issue :
  1. Update curl (version 8.4.0 or higher) in their linux box where they hosted ARD docker setup.
  2. Add below environment variable in ARD images: 
    1. Get list of ARD related containers using below command:
      • suffixes=("-hub" "-keycloak-aux" "-keycloak")
      • echo $(docker ps --format '{{.Names}}' | grep -E -- "$(IFS="|"; echo "${suffixes[*]}$")")
    2. set env variable in all above 3 containers as below : 
      • docker exec -it -u 0 <container_id> sh
      • export CURLPROXY_SOCKS5_HOSTNAME=''
      • exit

Additional Information

This KB will be updated on a continuous basis as the situation evolves.