Skip to content
Crypto Disclosed report Intermediate CVE-2021-22923

CVE-2021-22923: Metalink download sends credentials

When curl is built with libmetalink support and used with the --metalink and --user options, it sends the provided credentials to every host and protocol referenced in the metalink file, including plain HTTP and FTP. An attacker in a man-in-the-middle position or the operator of any referenced host could capture the credentials.

nyymi Follow

Originally disclosed on HackerOne

  • Triaged in 12 days
  • Fixed in 52 days
  • Paid in 31 days
  • Disclosed after 52 days

Summary:

When compiled --with-libmetalink and used with --metalink and --user curl will use the credentials for any further transfers performed. This includes different hosts and protocols, even ones without transport layer security such as http and ftp. As a result the credentials only intended for the target site may end up being sent to outside hosts, and without transport layer security, and may be intercepted by attackers in man in the middle network position.

For example HTTP redirects will not leak the credentials to other hosts unless if --location-trusted is used, thus this is unexpected and insecure behaviour.

Steps To Reproduce:

  1. Configure libcurl --with-libmetalink and build libcurl
  2. Have metalinktest.xml with <url> referencing data on different host than testsite and using http protocol
  3. Execute: curl --metalink --user professor:Joshua https://testsite/metalinktest.xml

The credentials can be seen by the target host and anyone in man in the middle position: Authorization: Basic cHJvZmVzc29yOkpvc2h1YQ==

Remarks

CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) might be a more accurate CWE.

Fix

  • Perhaps --location-trusted should be extended to apply to --metalink as well

Impact

Leak of credentials to unauthorized parties§

The original report as published on HackerOne, by nyymi. 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

Impact

Credentials intended for one site could be sent to unauthorised hosts and, over plain HTTP or FTP, intercepted by a man-in-the-middle attacker.

What the attacker needed

Curl built with libmetalink; user runs curl with --metalink and --user; metalink file references another host

The fix

The report suggests extending the --location-trusted option to also govern --metalink, so credentials are only forwarded when explicitly allowed.

How it was found

  1. Build libcurl with libmetalink support enabled.
  2. Create a metalink file whose url entry points to a different host over plain HTTP.
  3. Run curl with the metalink and user options against that file.
  4. Observe the Authorization header sent to the other host.

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.

curl is a command-line tool for downloading files. A metalink file is a list of alternative download locations. If you give curl a username and password for one site, it should only send them there. Here, curl also sent them to other sites listed in the metalink file, even over unencrypted connections, so anyone watching the network could read them.

What is Crypto?

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

More by nyymi

View all

51 more disclosed reports, 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.