Skip to content
Crypto Disclosed report Intermediate

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.

tannicarcher Follow

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:

  1. Inspect the lib/curl_ntlm_core.c file of the libcurl source code.
  2. Locate the use of the kCCAlgorithmDES constant, which corresponds to the DES cipher.
  3. 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.

The original report as published on HackerOne, by tannicarcher. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Inspect the libcurl source file that handles NTLM.
  2. Find the constant that selects the DES cipher.
  3. 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.

More by tannicarcher

View all

1 more disclosed report, best first.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.