Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 11 Oct 2023 07:59:02 +0200 (CEST)
From: Daniel Stenberg <>
To: curl security announcements -- curl users <>,, libcurl hacking <>,
Subject: [SECURITY ADVISORY] curl: CVE-2023-38546

cookie injection with none file

Project curl Security Advisory, October 11 2023 -


This flaw allows an attacker to insert cookies at will into a running program
using libcurl, if the specific series of conditions are met.

libcurl performs transfers. In its API, an application creates "easy handles"
that are the individual handles for single transfers.

libcurl provides a function call that duplicates en easy handle called

If a transfer has cookies enabled when the handle is duplicated, the
cookie-enable state is also cloned - but without cloning the actual
cookies. If the source handle did not read any cookies from a specific file on
disk, the cloned version of the handle would instead store the file name as
`none` (using the four ASCII letters, no quotes).

Subsequent use of the cloned handle that does not explicitly set a source to
load cookies from would then inadvertently load cookies from a file named
`none` - if such a file exists and is readable in the current directory of the
program using libcurl. And if using the correct file format of course.


The Common Vulnerabilities and Exposures (CVE) project has assigned the name
CVE-2023-38546 to this issue.

CWE-73: External Control of File Name or Path

Severity: Low

We set it to low because the flaw requires a series of conditions to be met
and the likeliness that they shall allow an attacker to take advantage of it
is low. Even if the bug could be made to trigger, the risk that a cookie
injection can be done to cause harm is additionally also low.


- Affected versions: libcurl 7.9.1 to and including 8.3.0
- Not affected versions: libcurl < 7.9.1 and >= 8.4.0
- Introduced-in:

libcurl is used by many applications, but not always advertised as such!

The (flawed) logic that created this bug existed even before the
`curl_easy_duphandle()` function was added, but it did not become this problem
until this API was introduced.

This flaw is not accessible using the curl command line tool.


Starting in curl 8.4.0, curl not longer stores the file name in the cookie struct.

- Fixed-in:


  A - Upgrade curl to version 8.4.0

  B - Apply the patch to your local version

  C - Call `curl_easy_setopt(cloned_curl, CURLOPT_COOKIELIST, "ALL");` right
      after every `curl_easy_duphandle();` call.


This issue was reported to the curl project on September 14, 2023. We contacted
distros@...nwall on October 3, 2023.

libcurl 8.4.0 was released on October 11 2023, coordinated with the
publication of this advisory.


- Reported-by: w0x42 on hackerone
- Patched-by: Daniel Stenberg

Thanks a lot!



Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.