ag-ui-protocol / ag-ui-protocol/ag-ui
[BUG]: Rust community SDK buffers without bounds and never dispatches CRLF-terminated frames
- Vorherrschende Sprache
- Python
- Sterne
- 15.9k
- Forks
- 1.4k
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 163
Beschreibung
# Rust community SDK buffers without bounds and never dispatches CRLF-terminated frames
Repository: https://github.com/ag-ui-protocol/ag-ui
Affected: community Rust SDK — `crates/ag-ui-client/src/sse.rs:75-145`
CWE: CWE-400 (Uncontrolled Resource Consumption)
## Summary
Two issues in the SSE frame parser:
1. Buffering is unbounded — no per-frame or total-size limit.
2. Frames are dispatched only on LF-style termination. The SSE specification permits `\r\n` (and `\r`) line endings; a stream using `\r\n` never completes a frame, so its bytes accumulate in the buffer for the entire connection.
## Impact
Memory exhaustion from either oversized events or spec-legal CRLF framing from a misbehaving or malicious endpoint. Availability only.
## Suggested remediation
- Treat `\r\n` and lone `\r` as line terminators.
- Enforce per-frame data-size and total-budget caps (see the Dart SDK's limits).
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.