Use of a Broken or Risky Cryptographic Algorithm (CWE-327) in libcurl
The libcurl source code uses the DES cipher in its NTLM authentication implementation. An attacker could potentially brute-force the short DES key to decrypt NTLM authentication traffic or perform man-in-the-middle attacks.
Originally disclosed on HackerOne
- Disclosed after 14 hours
Summary:
The DES cipher (Data Encryption Standard) is used in the curl_ntlm_core.c file of libcurl. DES is considered insecure due to its short key length (56 bits) and its susceptibility to brute-force attacks. Modern cryptographic standards recommend replacing DES with AES (Advanced Encryption Standard), which is more robust and secure.
Affected version
[Which curl/libcurl version are you using to reproduce? On which platform? curl -V typically generates good output to include]
Steps To Reproduce:
- Inspect the
lib/curl_ntlm_core.cfile of the libcurl source code. - Locate the use of the
kCCAlgorithmDESconstant, which corresponds to the DES cipher. - Verify that DES is being used for cryptographic operations in NTLM authentication (NTLMv1).
Supporting Material/References:
-
File:
lib/curl_ntlm_core.c -
Line Reference: 228:29
-
CWE Reference: CWE-327
- [attachment / reference]
Impact
Summary:
Using DES compromises the security of the application due to the following points:
- Brute-force attacks: The short key length makes it possible to brute-force DES keys in a reasonable amount of time with modern hardware.
- Cryptographic weaknesses: DES is vulnerable to various cryptanalysis techniques, such as differential and linear cryptanalysis.
- Compliance risks: DES does not meet modern cryptographic standards and could lead to non-compliance with security regulations.
An attacker exploiting this vulnerability could:
- Intercept and decrypt sensitive data during NTLM authentication.
- Execute man-in-the-middle (MITM) attacks to impersonate a user or server.
- Gain unauthorized access to systems relying on NTLM authentication.
Recommended Fix:
Replace the use of kCCAlgorithmDES with kCCAlgorithmAES, which supports stronger encryption standards (e.g., AES-128, AES-256). This change will significantly enhance the security of NTLM authentication in libcurl.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the code uses the outdated DES cipher for NTLM operations instead of a modern algorithm like AES.
Impact
An attacker could intercept and decrypt sensitive data during NTLM authentication, perform man-in-the-middle attacks, or gain unauthorised access to systems relying on NTLM.
What the attacker needed
NTLM authentication in use; attacker can intercept network traffic
The fix
The use of the DES constant should be replaced with an AES constant to provide stronger encryption for NTLM authentication.
How it was found
- Inspect the libcurl source file that handles NTLM.
- Find the constant that selects the DES cipher.
- Confirm that DES is used for NTLM authentication operations.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
DES is an old encryption method that uses a very short key, making it easy for modern computers to guess the key and read the protected data. This report points out that a library called libcurl uses DES when handling a login protocol called NTLM, which could let an attacker who intercepts the traffic decrypt it or impersonate a server.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.