ag-ui-protocol / ag-ui-protocol/ag-ui
[BUG]: Rust community SDK buffers without bounds and never dispatches CRLF-terminated frames
- Lenguaje dominante
- Python
- Estrellas
- 15.9k
- Forks
- 1.4k
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 163
Descripción
# 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).
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.