Technical impact
Improper neutralization of CRLF sequences in cowlib’s SSE encoder allows an attacker to inject carriage return characters into the id, event, data, or comment fields. cow_sse:event/1 guards the id and event fields against \n but not against bare \r, and the internal prefix_lines/2 function splits only on \n for data and comment fields. Because the SSE specification treats \r\n, \r, and \n as equivalent line terminators, an attacker can inject additional SSE lines, forging a complete event with an arbitrary type and payload. When a browser consumes these forged events, it may dispatch them to user-defined handlers or render them in the DOM, enabling client-side logic manipulation and stored-XSS-equivalent behaviour.
Affected Systems
The vulnerability affects the cowlib library by ninenines from 2.5.0 up to but excluding 2.16.1. No other vendors are impacted. Applications that use the cow_sse:event/1 function to construct SSE payloads are exposed.
Risk and Exploitability
The CVSS score of 6.3 indicates moderate severity, and the EPSS score is < 1%. The issue is not listed in the CISA KEV catalog. Exploitation requires that an attacker be able to supply CR or LF characters into the SSE field values sent to cow_sse:event/1. In typical deployments, browsers consume the forged events and may trigger unintended handling or DOM manipulation, posing a moderate to high risk for exposed services with minimal prerequisites.
Github GHSA