CVE-2021-22876
Description
curl/libcurl leaks credentials in Referer header when CURLOPT_AUTOREFERER is set, fixed in 7.76.0.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
curl/libcurl leaks credentials in Referer header when CURLOPT_AUTOREFERER is set, fixed in 7.76.0.
Vulnerability
libcurl versions 7.1.1 through 7.75.0, when the CURLOPT_AUTOREFERER option is enabled, automatically populate the Referer: HTTP request header with the full URL of the previous request, including any embedded user credentials (e.g., https://user:pass@example.com/). This affects both libcurl and the curl tool when using --referer ";auto". The credentials are not stripped before setting the header, leading to potential exposure [1].
Exploitation
An attacker must control a target server that the vulnerable client (with CURLOPT_AUTOREFERER enabled) makes a subsequent HTTP request to, after having made a prior request to a URL containing credentials. The Referer: header in the second request will contain the full URL of the first request, including the credentials, thus leaking them to the attacker-controlled server [1].
Impact
Successful exploitation results in the disclosure of sensitive user credentials (username and password) from the URL to an unauthorized third-party server. This can lead to unauthorized access to resources that the credentials protect [1].
Mitigation
Upgrade to curl 7.76.0, which fixes the issue by blanking out credentials from the URL before using it to populate the Referer: header [1]. Alternatively, apply the provided patch to local installations, avoid using CURLOPT_AUTOREFERER or --referer ";auto", or supply credentials via CURLOPT_USERPWD or -u instead of embedding them in the URL [1].
AI Insight generated on May 25, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
33- curl/curldescription
- osv-coords30 versionspkg:rpm/almalinux/curlpkg:rpm/almalinux/libcurlpkg:rpm/almalinux/libcurl-develpkg:rpm/almalinux/libcurl-minimalpkg:rpm/opensuse/curl&distro=openSUSE%20Leap%2015.2pkg:rpm/opensuse/curl&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/curl-mini&distro=openSUSE%20Leap%2015.2pkg:rpm/suse/curl&distro=SUSE%20Enterprise%20Storage%206pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Micro%205.0pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP2pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4-LTSSpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-BCLpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2015-LTSSpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/curl&distro=SUSE%20Manager%20Proxy%204.0pkg:rpm/suse/curl&distro=SUSE%20Manager%20Retail%20Branch%20Server%204.0pkg:rpm/suse/curl&distro=SUSE%20Manager%20Server%204.0pkg:rpm/suse/curl&distro=SUSE%20OpenStack%20Cloud%209pkg:rpm/suse/curl&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209pkg:rpm/suse/curl-openssl1&distro=SUSE%20Linux%20Enterprise%20Server%2011-SECURITY
< 7.61.1-22.el8+ 29 more
- (no CPE)range: < 7.61.1-22.el8
- (no CPE)range: < 7.61.1-22.el8
- (no CPE)range: < 7.61.1-22.el8
- (no CPE)range: < 7.61.1-22.el8
- (no CPE)range: < 7.66.0-lp152.3.15.1
- (no CPE)range: < 7.79.1-1.1
- (no CPE)range: < 7.66.0-lp152.3.15.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.66.0-4.14.1
- (no CPE)range: < 7.66.0-4.14.1
- (no CPE)range: < 7.60.0-4.20.1
- (no CPE)range: < 7.60.0-11.15.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-4.20.1
- (no CPE)range: < 7.60.0-11.15.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-11.15.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-3.42.1
- (no CPE)range: < 7.60.0-4.20.1
- (no CPE)range: < 7.60.0-4.20.1
- (no CPE)range: < 7.37.0-70.60.1
Patches
0No patches discovered yet.
Vulnerability mechanics
No source-code context for this CVE — mechanics is only generated when we can read the actual fix diff. Without that, the four sections (root cause, attack vector, affected code, fix) would be speculation rather than analysis.
References
10- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2ZC5BMIOKLBQJSFCHEDN2G2C2SH274BP/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ITVWPVGLFISU5BJC2BXBRYSDXTXE2YGC/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KQUIOYX2KUU6FIUZVB5WWZ6JHSSYSQWJ/mitrevendor-advisoryx_refsource_FEDORA
- security.gentoo.org/glsa/202105-36mitrevendor-advisoryx_refsource_GENTOO
- cert-portal.siemens.com/productcert/pdf/ssa-389290.pdfmitrex_refsource_CONFIRM
- curl.se/docs/CVE-2021-22876.htmlmitrex_refsource_MISC
- hackerone.com/reports/1101882mitrex_refsource_MISC
- lists.debian.org/debian-lts-announce/2021/05/msg00019.htmlmitremailing-listx_refsource_MLIST
- security.netapp.com/advisory/ntap-20210521-0007/mitrex_refsource_CONFIRM
- www.oracle.com//security-alerts/cpujul2021.htmlmitrex_refsource_MISC
News mentions
0No linked articles in our index yet.