Insufficiently Protected Credentials in curl - CVE-2022-27774
Summary
ALPINE-CVE-2022-27774: An insufficiently protected credentials vulnerability exists in curl 4.9 to and include curl 7.82.0 are affected that could allow an attacker to extract credentials when follows HTTP(S) redirects is used with authenticat... Affects curl versions < 7.79.1-r1. Fixed in 7.79.1-r1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
curl is a widely used command-line tool and library for transferring data with URLs. It supports various protocols including HTTP, HTTPS, FTP, and more. curl is known for its versatility and is often utilized in scripts and applications for data transfer. However, it is vulnerable to an issue where credentials may be leaked when following HTTP(S) redirects with authentication, posing a risk to user data and security.
Vulnerability Detail
The vulnerability identified as CVE-2022-27774 affects curl versions from 4.9 up to 7.82.0. It arises from insufficient protection of credentials during HTTP(S) redirects, which can allow attackers to extract sensitive information. If an authenticated request is redirected to a different service that uses a different protocol or port, credentials may inadvertently be exposed, leading to potential unauthorized access and data breaches.
How To Fix
Minimum fixed version
7.79.1-r1
This is the first release that contains the fix.
sudo apk add --upgrade curl
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary measure, avoid using curl with authentication when following redirects. This can be done by modifying your curl command to disable redirects using the -L option or by ensuring that sensitive operations do not involve redirects.
Conclusion
CVE-2022-27774 presents a significant risk to users of curl, particularly in scenarios involving authentication and redirects. It is crucial to update to the latest patched versions to mitigate this vulnerability and protect sensitive credentials from potential exposure.
See every vulnerability recorded for curl →
FAQ
CVE-2022-27774 is a vulnerability in curl that allows credentials to be leaked when following HTTP(S) redirects with authentication.
curl versions from 4.9 to 7.82.0 are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The CVSS score of CVE-2022-27774 is 5.7, indicating a moderate severity level.
If an immediate update is not possible, avoid using curl with authentication when following redirects as a temporary workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for curl.