CVE-2021-22898
JSON

3.1low

TELNET stack contents disclosure

Severity
3.1low CVSS:3.1 by CISA-ADP
Exploit likelihood
4.51% (higher than 91% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
hackerone
Also known as
CURL-CVE-2021-22898

Description

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

Product or packageVersionsReported by
https://github.com/curl/curl7.7 through 7.76.1CVE List
https://github.com/curl/curl.gitfrom 7.7 before 7.77.0, from a1d6ad26100bc493c7b04f1301b1634b7f5aa8b4 before 39ce47f219b09c380b81f89fe54ac586c8db6bdecurl
haxx curlfrom 7.7 up to 7.76.1NVD
debian debian_linux9.0NVD
fedoraproject fedora33, 34NVD
oracle communications_cloud_native_core_binding_support_function1.11.0NVD
oracle communications_cloud_native_core_network_function_cloud_native_environment1.10.0NVD
oracle communications_cloud_native_core_network_repository_function1.15.0, 1.15.1NVD
oracle communications_cloud_native_core_network_slice_selection_function1.8.0NVD
oracle communications_cloud_native_core_service_communication_proxy1.15.0NVD
oracle essbasebefore 11.1.2.4.047, from 21.0 before 21.3NVD
oracle mysql_serverbefore 5.7.34, from 8.0.15 before 8.0.25NVD

All scores

CISA-ADP3.1low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
curlmedium rating
NVD3.1low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
NVD2.6low CVSS:2.0AV:N/AC:H/Au:N/C:P/I:N/A:N

Classification

CWE-200CWE-909

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

curl

curl supports the -t command line option, known as CURLOPT_TELNETOPTIONS in libcurl. This rarely used option is used to send variable=content pairs to TELNET servers.

Due to 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. Therefore potentially revealing sensitive internal information to the server using a clear-text network protocol.

This could happen because curl did not check the return code from a sscanf(command, "%127[^,],%127s") function invoke correctly, and would leave the piece of the send buffer uninitialized for the value part if it was provided longer than 127 bytes. The buffer used for this is 2048 bytes big and the variable part of the variable=content pairs would be stored correctly in the send buffer, making curl sending "interleaved" bytes sequences of stack contents. A single curl TELNET handshake could then be made to send off a total of around 1800 bytes of (non-contiguous) stack contents in this style:

[control byte]name[control byte]
stack contents
[control byte]name[control byte]
stack contents
...

An easy proof of concept command line looks like this:

curl telnet://example.com -tNEW_ENV=a,bbbbbb (256 'b's)
NVD (es)

curl versiones 7.7 hasta 7.76.1 sufre de una divulgacion de información cuando la opción de línea de comandos "-t", conocida como "CURLOPT_TELNETOPTIONS" en libcurl, se usa para enviar pares de variables=contenido a servidores TELNET. Debido a un fallo en el analizador de opciones para el envío de variables NEW_ENV, podría hacer que libcurl pasara datos no inicializados de un búfer basado en la pila al servidor, resultando en una potencial divulgación de información interna confidencial al servidor que usaba un protocolo de red de texto sin cifrar

References

https://hackerone.com/reports/1176461exploit, issue-tracking, patch, third-party-advisory
https://curl.se/docs/CVE-2021-22898.htmlexploit, patch, vendor-advisory
https://github.com/curl/curl/commit/39ce47f219b09c380b81f89fe54ac586c8db6bdepatch, third-party-advisory
https://lists.apache.org/thread.html/rc713534b10f9daeee2e0990239fa407e2118e4aa9e88a7041177497c%40%3Cissues.guacamole.apache.org%3Emailing-list, third-party-advisory
https://www.oracle.com//security-alerts/cpujul2021.htmlpatch, third-party-advisory
http://www.openwall.com/lists/oss-security/2021/07/21/4mailing-list, patch, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/POOC3UV7V6L4CJ5KA2PTWTNUV5Y72T3Q/mailing-list, third-party-advisory, vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FRUCW2UVNYUDZF72DQLFQR4PJEC6CF7V/mailing-list, third-party-advisory, vendor-advisory
https://lists.debian.org/debian-lts-announce/2021/08/msg00017.htmlmailing-list, third-party-advisory
https://www.oracle.com/security-alerts/cpujan2022.htmlpatch, third-party-advisory
https://www.oracle.com/security-alerts/cpuapr2022.htmlpatch, third-party-advisory
https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdfpatch, third-party-advisory

Sources

SourceRecordLicence
CVE ListCVE-2021-22898 changed 2026-10-14CVE Terms of Use
curlCURL-CVE-2021-22898 changed 2026-10-25MIT
NVDCVE-2021-22898 changed 2026-10-14Public domain