CVE-2026-86252: h3 SSE event injection via unsanitized carriage return

CVE-2026-86252 · Severity: medium · CVSS 5.3 · Published 2026-09-06

h3 is a minimal HTTP framework for building web servers. It includes an EventStream class for Server-Sent Events (SSE), a common technique for real-time updates in chat, notifications, and AI applications. The vulnerability allows attackers who can control user input to inject malicious SSE directives via carriage return characters, enabling event spoofing (redirecting data to unintended handlers), message splitting, or UI manipulation. This is especially dangerous in applications that rely on custom event types for application logic.

Technologies: h3 (npm). Vendors: npm.

Quick answers

Is CVE-2026-86252 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-86252 being exploited in the wild.
How severe is CVE-2026-86252?
Medium severity, with a CVSS score of 5.3, published 6 September 2026.
Which products and versions are affected?
h3 (npm) SEMVER:introduced=2.0.0-beta.0,fixed=2.0.1-rc.17.
Is there a fix for CVE-2026-86252?
Yes. h3 (npm): upgrade to 2.0.1-rc.17 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-86252 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-86252?
Check whether you run h3 (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • h3 (npm): upgrade to 2.0.1-rc.17 or later
    npm install h3@2.0.1-rc.17

Technical details

The vulnerability is an incomplete fix (CWE-74: Improper Neutralization) in the SSE implementation. The formatEventStreamMessage() and formatEventStreamComment() functions split on \n only (via String.split("\n")), but the SSE RFC specifies that \r and \r\n are also valid line terminators. An attacker who controls data or comment fields can inject \r characters to break the intended SSE framing. For example, "legit\revent: evil" is emitted as a single "data:" line but parsed by the browser as two lines due to the \r terminator, causing injection of a custom "evil" event type. The _sanitizeSingleLine() function exists to strip both \r and \n, but it is only applied to the id and event fields, not to data or comment. The fix requires splitting on the regex /\r\n|\r|\n/ instead of just "\n".

Affected products

  • h3js h3 0 to 1.15.8, 2.0.0-beta.0 to 2.0.1-rc.16

Identifiers

  • CVE-2026-86252
  • GHSA-4hxc-9384-m385

Timeline

  • 2026-03-20: disclosed: GHSA-4hxc-9384-m385 published
  • 2026-03-20: patched: Fixed in h3 1.15.9 and 2.0.1-rc.17

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.