Cloudanix VulnDB

CVE-2021-22898

Low · 3.1

CVSS

3.1

EPSS

4.5%

Published

Jun 11, 2021

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A programming mistake in curl could send pieces of private computer memory to a remote server when certain telnet connection options are used.

Exploit Available
Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Moderate
Impact
Data Exposure
Component
Library
Class
Information Disclosure
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The option parser for CURLOPT_TELNETOPTIONS mishandles NEW_ENV variable pairs, causing uninitialized stack buffer contents to be transmitted to the TELNET server over clear text.

Why it matters to the business

Sensitive internal process memory or configuration data may leak to an external party during telnet-based operations; the flaw affects long-supported curl releases still present in many distributions and build pipelines.

How an attack unfolds

An attacker supplies a crafted -t/--telnet-option string containing NEW_ENV variables to a curl client configured to connect to a malicious or compromised TELNET endpoint; the uninitialized buffer contents are sent verbatim, exposing whatever data happened to be on the stack at that moment.

How to fix it

Upgrade curl to a version containing commit 39ce47f219b09c380b81f89fe54ac586c8db6bde or later; Debian 11/12/13 users should install c-ares 1.16.1-1 or newer packages that incorporate the corrected libcurl build.

How to confirm the fix worked

Confirm the installed curl binary reports a version newer than 7.76.1 and that the git hash or package changelog references the listed fix commit; re-run any telnet-option test cases with memory sanitizers to verify no uninitialized data is transmitted.

Typical attack path

  1. Identify or lure a target into invoking curl with the -t option against a TELNET destination under attacker control
  2. Craft a NEW_ENV variable pair that triggers the parser flaw
  3. Receive the leaked stack bytes in the clear-text session
  4. Inspect the received data for credentials, tokens, or other sensitive material

How to detect it

Search outbound network logs and process execution history for curl invocations that include the -t flag or CURLOPT_TELNETOPTIONS together with TELNET destinations; inspect packet captures on port 23 for unexpected binary or high-entropy payloads immediately after the NEW_ENV exchange.

What your security team should do

  • Prioritize patching curl in all CI/CD agents, containers, and developer workstations that still ship versions 7.7-7.76.1
  • Audit scripts and automation for use of -t or CURLOPT_TELNETOPTIONS and replace with safer alternatives where possible
  • Add curl version checks to software bill-of-materials pipelines given the high ecosystem prevalence of the library

The record

curl 7.7 through 7.76.1 suffers from an information disclosure when the `-t` command line option, known as `CURLOPT_TELNETOPTIONS` in libcurl, is used to send variable=content pairs to TELNET servers. Due to a flaw in the option parser for sending NEW_ENV variables, libcurl could be made to pass on uninitialized data from a stack based buffer to the server, resulting in potentially revealing sensitive internal information to the server using a clear-text network protocol.

Affected packages

Ecosystem Package Introduced Fixed
AlmaLinux:8 curl 0 7.61.1-22.el8
AlmaLinux:8 libcurl 0 7.61.1-22.el8
AlmaLinux:8 libcurl-devel 0 7.61.1-22.el8
AlmaLinux:8 libcurl-minimal 0 7.61.1-22.el8
Alpine:v3.10 curl 0 7.66.0-r4
Alpine:v3.11 curl 0 7.67.0-r4
Alpine:v3.12 curl 0 7.77.0-r0
Alpine:v3.13 curl 0 7.77.0-r0
Alpine:v3.14 curl 0 7.77.0-r0
Alpine:v3.15 curl 0 7.77.0-r0
Alpine:v3.16 curl 0 7.77.0-r0
Alpine:v3.17 curl 0 7.77.0-r0
Alpine:v3.18 curl 0 7.77.0-r0
Alpine:v3.19 curl 0 7.77.0-r0
Alpine:v3.20 curl 0 7.77.0-r0
Alpine:v3.21 curl 0 7.77.0-r0
Alpine:v3.22 curl 0 7.77.0-r0
Debian:10 curl 0 7.64.0-4+deb10u3
Debian:11 curl 0 7.74.0-1.3+deb11u2
Debian:12 curl 0 7.79.1-1
Debian:13 curl 0 7.79.1-1
Debian:9 curl 0 7.52.1-5+deb9u15
Mageia:7 curl 0 7.71.0-1.3.mga7
Mageia:8 curl 0 7.74.0-1.2.mga8
Red Hat:enterprise_linux:8::baseos curl 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos curl-debuginfo 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos curl-debugsource 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos curl-minimal-debuginfo 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos libcurl 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos libcurl-debuginfo 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos libcurl-devel 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos libcurl-minimal 0 0:7.61.1-22.el8
Red Hat:enterprise_linux:8::baseos libcurl-minimal-debuginfo 0 0:7.61.1-22.el8
Rocky Linux:8 curl 0 0:7.61.1-22.el8
SUSE:Enterprise Storage 6 curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise High Performance Computing 15-ESPOS curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise High Performance Computing 15-LTSS curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise Micro 5.0 curl 0 7.66.0-4.17.1
SUSE:Linux Enterprise Module for Basesystem 15 SP2 curl 0 7.66.0-4.17.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 curl 0 7.66.0-4.17.1
SUSE:Linux Enterprise Point of Sale 11 SP3 curl 0 7.37.0-70.66.1
SUSE:Linux Enterprise Server 11 SP4-LTSS curl 0 7.37.0-70.66.1
SUSE:Linux Enterprise Server 11-SECURITY curl-openssl1 0 7.37.0-70.63.1
SUSE:Linux Enterprise Server 11-SECURITY curl-openssl1 0 7.37.0-70.66.1
SUSE:Linux Enterprise Server 12 SP4-LTSS curl 0 7.60.0-4.20.1
SUSE:Linux Enterprise Server 12 SP5 curl 0 7.60.0-11.18.1
SUSE:Linux Enterprise Server 15 SP1-BCL curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise Server 15 SP1-LTSS curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise Server 15-LTSS curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP4 curl 0 7.60.0-4.20.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 curl 0 7.60.0-11.18.1
SUSE:Linux Enterprise Server for SAP Applications 15 curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 curl 0 7.60.0-3.42.1
SUSE:Linux Enterprise Software Development Kit 12 SP5 curl 0 7.60.0-11.18.1
SUSE:Manager Proxy 4.0 curl 0 7.60.0-3.42.1
SUSE:Manager Retail Branch Server 4.0 curl 0 7.60.0-3.42.1
SUSE:Manager Server 4.0 curl 0 7.60.0-3.42.1
SUSE:OpenStack Cloud 9 curl 0 7.60.0-4.20.1
SUSE:OpenStack Cloud Crowbar 9 curl 0 7.60.0-4.20.1
Ubuntu:18.04:LTS curl 0 7.58.0-2ubuntu3.14
Ubuntu:20.04:LTS curl 0 7.68.0-1ubuntu2.6
Ubuntu:Pro:14.04:LTS curl 0 7.35.0-1ubuntu2.20+esm14
Ubuntu:Pro:16.04:LTS curl 0 7.47.0-1ubuntu2.19+esm3
Ubuntu:Pro:16.04:LTS curl 0 7.47.0-1ubuntu2.19+esm7
openSUSE:Leap 15.2 curl 0 7.66.0-lp152.3.18.1
openSUSE:Leap 15.2 curl-mini 0 7.66.0-lp152.3.18.1
openSUSE:Leap 15.3 curl 0 7.66.0-4.17.1
openSUSE:Leap 15.3 curl-mini 0 7.66.0-4.17.1
openSUSE:Tumbleweed curl 0 7.79.1-1.1

Related vulnerabilities