This vulnerability occurs when an application uses carriage return and line feed characters (CRLF) to structure data, like separating lines or records, but fails to properly sanitize these sequences from user-supplied input before processing.

CRLF injection, often called 'HTTP Response Splitting' in web contexts, happens because attackers can inject the characters \r\n (CRLF) into input fields. When this unsanitized input is later used to construct structured outputs like HTTP headers, log files, or email headers, the injected characters can create new lines or entries. This allows attackers to manipulate the application's behavior, forge log entries, or inject malicious content that other users might see. To prevent this, developers must rigorously validate and sanitize all user-controlled data that influences output formatting. This involves encoding or stripping CRLF sequences (\r, \n, and their encoded equivalents like %0d%0a) before the data is used in any context where these characters have special meaning, such as HTTP responses, generated files, or system commands.
Impact: Modify Application Data
javabashbashbashjava