Skip to content
Memory corruption Disclosed report Advanced CVE-2026-9080

UAF read in mev_pollset_diff() trace path after curl_easy_pause() in socket callback

A use-after-free read occurs in mev_pollset_diff() when a socket callback calls curl_easy_pause(), freeing the sh_entry, and a subsequent trace macro dereferences the stale pointer. An attacker could cause a crash (denial of service) or leak stale heap bytes into the application's trace output, but only under narrow conditions.

homanp Follow

Originally disclosed on HackerOne

  • Disclosed after 3 days

Summary:

The CVE-2026-9080 fix re-fetches the sh_entry after the socket callback inside mev_sh_entry_update(), because curl_easy_pause() called from that callback re-enters mev_assess() and can free the entry. The same re-fetch was not applied at the caller, mev_pollset_diff(), which dereferences its own entry pointer again in a CURL_TRC_M() trace call immediately after the callback returns (lib/multi_ev.c:435-436). On the exact reentrancy and free path that 9080 patched, that trace reads &entry->xfers and entry->conn from freed memory. It only fires in verbose-strings builds (the default) with multi tracing enabled, because the dereference lives inside the trace macro's arguments, which is why the 9080 PoC did not surface it. This is an incomplete-fix residual of 9080 rather than a new issue, with a one-line fix.

Affected version

Reproduced on libcurl 8.21.0 / current git master (the release that shipped the 9080 fix).

Steps To Reproduce:

  1. Build libcurl with verbose strings (default) and AddressSanitizer.
  2. Use the curl_multi_socket_action() event interface with a registered CURLMOPT_SOCKETFUNCTION.
  3. From inside the socket callback, call curl_easy_pause(easy, CURLPAUSE_RECV) on a transfer whose socket action is being removed (the same trigger as CVE-2026-9080), so the reentrant mev_assess() frees the sh_entry for that socket.
  4. Enable multi tracing (--trace-config all, or a handle where CURL_TRC_M_is_verbose() is true).
  5. ASan reports a heap-use-after-free read in mev_pollset_diff() at the CURL_TRC_M() call right after mev_sh_entry_update() (lib/multi_ev.c:435-436): Curl_uint32_spbset_count(&entry->xfers) and entry->conn read the freed entry.

Suggested fix

Re-fetch and guard after the callback, matching the idiom already used in mev_sh_entry_update():

C
mresult = mev_sh_entry_update(multi, data, entry, s,
                              prev_ps->actions[i], 0);
if(mresult)
  return mresult;
/* the callback may have freed this entry via curl_easy_pause(); re-fetch */
entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
if(entry)
  CURL_TRC_M(data, "ev entry fd=%" FMT_SOCKET_T ", removed transfer, "
             "total=%u/%d (xfer/conn)", s,
             Curl_uint32_spbset_count(&entry->xfers),
             entry->conn ? 1 : 0);

Alternatively capture the two counts into locals before the call and trace those, or drop the entry-derived fields from the trace line.

Impact

Summary:

A use-after-free read of a freed mev_sh_entry: in practice a crash (DoS), or stale heap bytes read into the application's multi trace output. It is a read, not a write, so there is no write primitive and no control-flow hijack. The stale bytes only reach the application's own trace/debug sink, so by themselves they are not disclosed to a remote party. Triggering requires the multi socket event interface, a socket callback that pauses so the entry is freed, and multi tracing enabled in a verbose-strings build; as the team noted for 9080, pausing from a socket callback is unusual, so exposure is narrow. I would rate this Low, strictly below 9080 (rated Low) since it adds the tracing condition. Proposed vector CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L, deferring to your scoring.

The original report as published on HackerOne, by homanp. 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 caller mev_pollset_diff() did not re-fetch the sh_entry pointer after the socket callback, which could free it via curl_easy_pause(), unlike the fix applied in mev_sh_entry_update().

Impact

The bug could cause a crash (denial of service) or leak stale heap bytes into the application's trace output, but only when the multi socket event interface, a pausing socket callback, and multi tracing in a verbose-strings build are all present; it is a read, not a write, so no control-flow hijack is possible.

What the attacker needed

Multi socket event interface; socket callback that pauses; multi tracing enabled; verbose-strings build

The fix

The fix should re-fetch and guard the entry pointer after the callback, matching the idiom already used in mev_sh_entry_update(), or capture the needed counts into locals before the call.

How it was found

  1. Build libcurl with verbose strings and AddressSanitizer.
  2. Use the curl_multi_socket_action() event interface with a registered socket callback.
  3. From inside the socket callback, call curl_easy_pause() on a transfer whose socket action is being removed, causing the entry to be freed.
  4. Enable multi tracing.
  5. Observe AddressSanitizer reporting a heap-use-after-free read in mev_pollset_diff() at the trace call.

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.

A use-after-free happens when a program keeps using memory after it has been freed. Here, a callback function frees a data structure, but the code that called it still tries to read from that structure for a debug message. This can crash the program or print leftover memory contents.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.