Vulnerabilities / CVE-2021-22945

critical

CVE-2021-22945

curl: use-after-free and double-free in MQTT sending

Published Modified CWE 415
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Red Hat9.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Julia9.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

Trivy's own label is CRITICAL. Rated critical by NVD, CBL-Mariner, Julia, Photon OS. Rated lower by Red Hat (medium), Amazon (medium), Ubuntu (medium).

Description

When sending data to an MQTT server, libcurl <= 7.73.0 and 7.78.0 could in some circumstances erroneously keep a pointer to an already freed memory area and both use that again in a subsequent call to send data and also free it *again*.

Affected packages and fixed versions

SourcePackageFixed in
CBL-Mariner 1.0curl0:7.76.0-6.cm1
CBL-Mariner 2.0curl0:7.82.0-1.cm2
julia::Julia Ecosystem Security AdvisoriesLibCURL_jll7.81.0+0
Photon OS 1.0curl7.78.0-2.ph1
Photon OS 2.0curl7.78.0-2.ph2
Photon OS 3.0curl7.78.0-2.ph3
Photon OS 4.0curl, curl-devel, curl-libs7.78.0-2.ph4
alpine 3.11curl7.79.0-r0
alpine 3.12curl7.79.0-r0
alpine 3.13curl7.79.0-r0
alpine 3.14curl7.79.0-r0
alpine 3.15curl7.79.0-r0
Show all 46 entries from 36 sources
SourcePackageFixed in
CBL-Mariner 1.0curl0:7.76.0-6.cm1
CBL-Mariner 2.0curl0:7.82.0-1.cm2
julia::Julia Ecosystem Security AdvisoriesLibCURL_jll7.81.0+0
Photon OS 1.0curl7.78.0-2.ph1
Photon OS 2.0curl7.78.0-2.ph2
Photon OS 3.0curl7.78.0-2.ph3
Photon OS 4.0curl7.78.0-2.ph4
Photon OS 4.0curl-devel7.78.0-2.ph4
Photon OS 4.0curl-libs7.78.0-2.ph4
alpine 3.11curl7.79.0-r0
alpine 3.12curl7.79.0-r0
alpine 3.13curl7.79.0-r0
alpine 3.14curl7.79.0-r0
alpine 3.15curl7.79.0-r0
alpine 3.16curl7.79.0-r0
alpine 3.17curl7.79.0-r0
alpine 3.18curl7.79.0-r0
alpine 3.19curl7.79.0-r0
alpine 3.20curl7.79.0-r0
alpine 3.21curl7.79.0-r0
alpine 3.22curl7.79.0-r0
alpine 3.23curl7.79.0-r0
alpine 3.24curl7.79.0-r0
alpine edgecurl7.79.0-r0
amazon linux 2curl7.79.1-1.amzn2.0.1
amazon linux 2curl-debuginfo7.79.1-1.amzn2.0.1
amazon linux 2libcurl7.79.1-1.amzn2.0.1
amazon linux 2libcurl-devel7.79.1-1.amzn2.0.1
conan::GitLab Advisory Database Communitylibcurl7.79.1
debian 11curl7.74.0-1.3+deb11u2
debian 12curl7.79.1-1
debian 13curl7.79.1-1
debian 14curl7.79.1-1
echocurl7.79.1-1
echocurl-7.69.17.69.1+e1
Red Hatcurlno fix listed
Red Hatlibcurlno fix listed
Red Hatrh-dotnet21-curlno fix listed
Red Hatrh-dotnet21-libcurlno fix listed
Red Hatrh-dotnet21-libcurl-develno fix listed
root.io debian 11rootio-curl7.74.0-1.3+deb11u2
root.io debian 12rootio-curl7.79.1-1
root.io debian 13rootio-curl7.79.1-1
ubuntu 21.04curl7.74.0-1ubuntu2.3
ubuntu 21.10curl7.74.0-1.3ubuntu2
ubuntu 22.04curl7.74.0-1.3ubuntu2

References

All 17 references

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.