CVE-2021-22922
JSON

6.5medium

Wrong content via Metalink not discarded

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

Description

When curl is instructed to download content using the metalink feature, thecontents is verified against a hash provided in the metalink XML file.The metalink XML file points out to the client how to get the same contentfrom a set of different URLs, potentially hosted by different servers and theclient can then download the file from one or several of them. In a serial orparallel manner.If one of the servers hosting the contents has been breached and the contentsof the specific file on that server is replaced with a modified payload, curlshould detect this when the hash of the file mismatches after a completeddownload. It should remove the contents and instead try getting the contentsfrom another URL. This is not done, and instead such a hash mismatch is onlymentioned in text and the potentially malicious content is kept in the file ondisk.

Affected

Product or packageVersionsReported by
https://github.com/curl/curlcurl 7.27.0 to and including 7.77.0CVE List
https://github.com/curl/curl.gitfrom 7.27.0 before 7.78.0, from b5fdbe848bc3d088445817aa890d3f2f74ac5b02 before 265b14d6b37c4298bd5556fabcbc37d36f911693curl
haxx curlfrom 7.27.0 before 7.78.0NVD
fedoraproject fedora33NVD
netapp cloud_backupNot specifiedNVD
netapp clustered_data_ontapNot specifiedNVD
netapp hci_management_nodeNot specifiedNVD
netapp solidfireNot specifiedNVD
oracle mysql_serverfrom 5.7.0 up to 5.7.35, from 8.0.0 up to 8.0.26NVD
siemens sinec_infrastructure_network_servicesbefore 1.0.1.1NVD
netapp h300s_firmwareNot specifiedNVD
netapp h500s_firmwareNot specifiedNVD

All scores

CISA-ADP6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
curlmedium rating
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
NVD4.3medium CVSS:2.0AV:N/AC:M/Au:N/C:N/I:P/A:N

Classification

CWE-755CWE-840

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

What each source says

CVE List

When curl is instructed to download content using the metalink feature, thecontents is verified against a hash provided in the metalink XML file.The metalink XML file points out to the client how to get the same contentfrom a set of different URLs, potentially hosted by different servers and theclient can then download the file from one or several of them. In a serial orparallel manner.If one of the servers hosting the contents has been breached and the contentsof the specific file on that server is replaced with a modified payload, curlshould detect this when the hash of the file mismatches after a completeddownload. It should remove the contents and instead try getting the contentsfrom another URL. This is not done, and instead such a hash mismatch is onlymentioned in text and the potentially malicious content is kept in the file ondisk.

curl

When curl is instructed to download content using the Metalink feature, the contents is verified against a hash provided in the Metalink XML file.

The Metalink XML file points out to the client how to get the same content from a set of different URLs, potentially hosted by different servers and the client can then download the file from one or several of them. In a serial or parallel manner.

If one of the servers hosting the contents has been breached and the contents of the specific file on that server is replaced with a modified payload, curl should detect this when the hash of the file mismatches after a completed download. It should remove the contents and instead try getting the contents from another URL. This is not done, and instead such a hash mismatch is only mentioned in text and the potentially malicious content is kept in the file on disk.

There is a risk the user does not notice the message and instead assumes the file is fine.

NVD (es)

Cuando es instruido a curl descargar un contenido usando la funcionalidad metalink, el contenido es comprobado con un hash proporcionado en el archivo XML metalink. El archivo XML metalink indica al cliente cómo obtener el mismo contenido de un conjunto de URLs diferentes, potencialmente alojadas en distintos servidores y el cliente puede entonces descargar el archivo de uno o varios de ellos. En una manera paralela o en serie. Si uno de los servidores que aloja el contenido ha sido violado y el contenido del archivo específico en ese servidor es reemplazado por una carga útil modificada, Curl debería detectar esto cuando el hash del archivo no coincide después de una descarga completa. Debería eliminar los contenidos y tratar de obtenerlo de otra URL. Esto no se hace, y en su lugar, tal desajuste de hash sólo se menciona en el texto y el contenido potencialmente malicioso se mantiene en el archivo en el disco

References

https://hackerone.com/reports/1213175exploit, issue-tracking, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FRUCW2UVNYUDZF72DQLFQR4PJEC6CF7V/mailing-list, third-party-advisory, vendor-advisory
https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cdev.kafka.apache.org%3Emailing-list, third-party-advisory
https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cusers.kafka.apache.org%3Emailing-list, third-party-advisory
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cusers.kafka.apache.org%3Emailing-list, third-party-advisory
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cdev.kafka.apache.org%3Emailing-list, third-party-advisory
https://www.oracle.com/security-alerts/cpuoct2021.htmlpatch, third-party-advisory
https://security.netapp.com/advisory/ntap-20210902-0003/third-party-advisory
https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdfpatch, third-party-advisory
https://security.gentoo.org/glsa/202212-01third-party-advisory, vendor-advisory
https://cert-portal.siemens.com/productcert/html/ssa-389290.html
https://cert-portal.siemens.com/productcert/html/ssa-398330.html

Sources

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