Cloudanix VulnDB

CVE-2022-32221

Critical · 9.8

CVSS

9.8

EPSS

5.1%

Published

Dec 5, 2022

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A programming mistake in the curl network library can cause programs that reuse connections to send the wrong information or crash, potentially exposing data or interrupting services.

Exploit Available
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Full Compromise
Component
Library
Class
Use After Free
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

libcurl reuses a handle previously configured for PUT with CURLOPT_READFUNCTION and then incorrectly invokes that callback during a subsequent POST that sets CURLOPT_POSTFIELDS, resulting in use-after-free, memory corruption, or transmission of unintended data.

Why it matters to the business

Applications performing repeated HTTP transfers with libcurl may leak sensitive data, crash, or send incorrect payloads, leading to service disruption, data exposure, or failed operations in any software relying on curl for network requests.

How an attack unfolds

An attacker supplies input that causes an application to reuse a single curl handle, first issuing a PUT that registers a read callback and later a POST that supplies POSTFIELDS; libcurl erroneously calls the stale callback, triggering memory corruption or data leakage that the attacker can observe or leverage for further compromise.

How to fix it

Upgrade libcurl to the commit cd95ee9f771361acf241629d2fe5507e308082a2 or later; rebuild and redeploy all dependent applications after updating the library.

How to confirm the fix worked

Confirm the installed libcurl version or commit hash includes cd95ee9f771361acf241629d2fe5507e308082a2; exercise handle reuse from PUT to POST in a test harness and verify that the read callback is no longer invoked for POSTFIELDS requests.

Typical attack path

  1. Identify an application that reuses curl handles across request types
  2. Trigger a PUT request that sets CURLOPT_READFUNCTION
  3. Follow with a POST request that sets CURLOPT_POSTFIELDS on the same handle
  4. Observe or induce use-after-free behavior to read or corrupt memory
  5. Leverage resulting corruption or leaked data for further attacks

How to detect it

Review application logs for curl-related crashes, segmentation faults, or unexpected memory errors around HTTP POST operations; inspect network traffic for anomalous payload sizes or content after handle-reuse sequences; search process memory dumps for signs of freed callback structures being accessed.

What your security team should do

  • Immediately update all curl installations to the fixed commit and rebuild dependent software
  • Audit applications for curl handle reuse patterns and replace with fresh handles where possible
  • Monitor for memory corruption crashes or anomalous HTTP payload sizes in curl-using services
  • Prioritize patching in internet-facing or high-value services given public exploit availability

The record

When doing HTTP(S) transfers, libcurl might erroneously use the read callback (`CURLOPT_READFUNCTION`) to ask for data to send, even when the `CURLOPT_POSTFIELDS` option has been set, if the same handle previously was used to issue a `PUT` request which used that callback. This flaw may surprise the application and cause it to misbehave and either send off the wrong data or use memory after free or similar in the subsequent `POST` request. The problem exists in the logic for a reused handle when it is changed from a PUT to a POST.

Affected packages

Ecosystem Package Introduced Fixed
AlmaLinux:9 curl 0 7.76.1-19.el9_1.1
AlmaLinux:9 curl-minimal 0 7.76.1-19.el9_1.1
AlmaLinux:9 libcurl 0 7.76.1-19.el9_1.1
AlmaLinux:9 libcurl-devel 0 7.76.1-19.el9_1.1
AlmaLinux:9 libcurl-minimal 0 7.76.1-19.el9_1.1
Alpine:v3.15 curl 0 7.80.0-r4
Alpine:v3.16 curl 0 7.83.1-r4
Alpine:v3.17 curl 0 7.86.0-r0
Alpine:v3.18 curl 0 7.86.0-r0
Alpine:v3.19 curl 0 7.86.0-r0
Alpine:v3.20 curl 0 7.86.0-r0
Alpine:v3.21 curl 0 7.86.0-r0
Alpine:v3.22 curl 0 7.86.0-r0
Chainguard curl 0 7.86.0-r0
Chainguard curl-dev 0 7.86.0-r0
Chainguard curl-doc 0 7.86.0-r0
Chainguard curl-oci-entrypoint 0 7.86.0-r0
Chainguard curl-static 0 7.86.0-r0
Chainguard libcurl-openssl4 0 7.86.0-r0
Chainguard libcurl4 0 7.86.0-r0
Debian:10 curl 0 7.64.0-4+deb10u4
Debian:11 curl 0 7.74.0-1.3+deb11u5
Debian:12 curl 0 7.86.0-1
Debian:13 curl 0 7.86.0-1
Mageia:8 curl 0 7.74.0-1.9.mga8
Red Hat:enterprise_linux:9::appstream curl 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream curl-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream curl-debugsource 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream curl-minimal 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream curl-minimal-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream libcurl 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream libcurl-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream libcurl-devel 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream libcurl-minimal 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::appstream libcurl-minimal-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos curl 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos curl-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos curl-debugsource 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos curl-minimal 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos curl-minimal-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos libcurl 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos libcurl-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos libcurl-devel 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos libcurl-minimal 0 0:7.76.1-19.el9_1.1
Red Hat:enterprise_linux:9::baseos libcurl-minimal-debuginfo 0 0:7.76.1-19.el9_1.1
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-curl 0 0:7.86.0-2.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-curl-debuginfo 0 0:7.86.0-2.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-httpd 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-httpd-debuginfo 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-httpd-devel 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-httpd-manual 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-httpd-selinux 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-httpd-tools 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-libcurl 0 0:7.86.0-2.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-libcurl-devel 0 0:7.86.0-2.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-mod_http2 0 0:1.15.19-20.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-mod_http2-debuginfo 0 0:1.15.19-20.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-mod_ldap 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-mod_proxy_html 0 1:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-mod_session 0 0:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-mod_ssl 0 1:2.4.51-37.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-openssl 0 1:1.1.1k-13.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-openssl-debuginfo 0 1:1.1.1k-13.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-openssl-devel 0 1:1.1.1k-13.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-openssl-libs 0 1:1.1.1k-13.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-openssl-perl 0 1:1.1.1k-13.el7jbcs
Red Hat:jboss_core_services:1::el7 jbcs-httpd24-openssl-static 0 1:1.1.1k-13.el7jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-curl 0 0:7.86.0-2.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-curl-debuginfo 0 0:7.86.0-2.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-httpd 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-httpd-debuginfo 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-httpd-devel 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-httpd-manual 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-httpd-selinux 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-httpd-tools 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-httpd-tools-debuginfo 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-libcurl 0 0:7.86.0-2.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-libcurl-debuginfo 0 0:7.86.0-2.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-libcurl-devel 0 0:7.86.0-2.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_http2 0 0:1.15.19-20.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_http2-debuginfo 0 0:1.15.19-20.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_ldap 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_ldap-debuginfo 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_proxy_html 0 1:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_proxy_html-debuginfo 0 1:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_session 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_session-debuginfo 0 0:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_ssl 0 1:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-mod_ssl-debuginfo 0 1:2.4.51-37.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-openssl 0 1:1.1.1k-13.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-openssl-debuginfo 0 1:1.1.1k-13.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-openssl-devel 0 1:1.1.1k-13.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-openssl-libs 0 1:1.1.1k-13.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-openssl-libs-debuginfo 0 1:1.1.1k-13.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-openssl-perl 0 1:1.1.1k-13.el8jbcs
Red Hat:jboss_core_services:1::el8 jbcs-httpd24-openssl-static 0 1:1.1.1k-13.el8jbcs
Red Hat:rhel_eus:9.0::appstream curl 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream curl-debuginfo 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream curl-debugsource 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream curl-minimal 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream curl-minimal-debuginfo 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream libcurl 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream libcurl-debuginfo 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream libcurl-devel 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream libcurl-minimal 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::appstream libcurl-minimal-debuginfo 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos curl 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos curl-debuginfo 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos curl-debugsource 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos curl-minimal 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos curl-minimal-debuginfo 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos libcurl 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos libcurl-debuginfo 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos libcurl-devel 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos libcurl-minimal 0 0:7.76.1-14.el9_0.6
Red Hat:rhel_eus:9.0::baseos libcurl-minimal-debuginfo 0 0:7.76.1-14.el9_0.6
Rocky Linux:9 curl 0 0:7.76.1-19.el9_1.1
SUSE:Enterprise Storage 6 curl 0 7.60.0-150000.38.1
SUSE:Enterprise Storage 7 curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise High Performance Computing 15-ESPOS curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise High Performance Computing 15-LTSS curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise Micro 5.1 curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise Micro 5.2 curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise Micro 5.3 curl 0 7.79.1-150400.5.9.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise Module for Basesystem 15 SP4 curl 0 7.79.1-150400.5.9.1
SUSE:Linux Enterprise Server 12 SP2-BCL curl 0 7.37.0-37.85.1
SUSE:Linux Enterprise Server 12 SP3-BCL curl 0 7.37.0-37.85.1
SUSE:Linux Enterprise Server 12 SP4-LTSS curl 0 7.60.0-4.43.1
SUSE:Linux Enterprise Server 12 SP5 curl 0 7.60.0-11.49.1
SUSE:Linux Enterprise Server 15 SP1-BCL curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise Server 15 SP1-LTSS curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise Server 15 SP2-BCL curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise Server 15 SP2-LTSS curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise Server 15-LTSS curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP4 curl 0 7.60.0-4.43.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 curl 0 7.60.0-11.49.1
SUSE:Linux Enterprise Server for SAP Applications 15 curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 curl 0 7.60.0-150000.38.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 curl 0 7.66.0-150200.4.42.1
SUSE:Linux Enterprise Software Development Kit 12 SP5 curl 0 7.60.0-11.49.1
SUSE:Manager Proxy 4.1 curl 0 7.66.0-150200.4.42.1
SUSE:Manager Retail Branch Server 4.1 curl 0 7.66.0-150200.4.42.1
SUSE:Manager Server 4.1 curl 0 7.66.0-150200.4.42.1
SUSE:OpenStack Cloud 9 curl 0 7.60.0-4.43.1
SUSE:OpenStack Cloud Crowbar 9 curl 0 7.60.0-4.43.1
Ubuntu:18.04:LTS curl 0 7.58.0-2ubuntu3.21
Ubuntu:18.04:LTS mysql-5.7 0 5.7.41-0ubuntu0.18.04.1
Ubuntu:20.04:LTS curl 0 7.68.0-1ubuntu2.14
Ubuntu:20.04:LTS mysql-8.0 0 8.0.32-0buntu0.20.04.1
Ubuntu:22.04:LTS curl 0 7.81.0-1ubuntu1.6
Ubuntu:22.04:LTS mysql-8.0 0 8.0.32-0buntu0.22.04.1
Ubuntu:Pro:14.04:LTS curl 0 7.35.0-1ubuntu2.20+esm13
Ubuntu:Pro:16.04:LTS curl 0 7.47.0-1ubuntu2.19+esm6
Wolfi curl 0 7.86.0-r0
Wolfi curl-dev 0 7.86.0-r0
Wolfi curl-doc 0 7.86.0-r0
Wolfi curl-oci-entrypoint 0 7.86.0-r0
Wolfi curl-static 0 7.86.0-r0
Wolfi libcurl-openssl4 0 7.86.0-r0
Wolfi libcurl4 0 7.86.0-r0
openSUSE:Leap 15.3 curl 0 7.66.0-150200.4.42.1
openSUSE:Leap 15.4 curl 0 7.79.1-150400.5.9.1
openSUSE:Leap Micro 5.2 curl 0 7.66.0-150200.4.42.1
openSUSE:Tumbleweed curl 0 7.86.0-1.1

Related vulnerabilities