Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.33 KB

crlf-injection.md

File metadata and controls

33 lines (25 loc) · 1.33 KB
name severity cvss-score cvss-vector cwe-id cwe-name compliance
CRLF injection
low
3.7
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
CWE-93
Improper Neutralization of CRLF Sequences ('CRLF Injection')
HIPAA ISO 27001 owasp10 pci PCI v4.0
164.306(a)
A.5.33, A.5.34, A.8.3, A.8.12
A3
6.5.1
pci4-6.2.4

A CRLF injection vulnerability allows an attacker to inject a CR (Carriage Return: ASCII 13, \r) and a LF (Line Feed: ASCII 10, \n) in user inputs, which are then inserted in the response to terminate lines and divide the header from the body in HTTP responses, in an unexpected manner.

With a CRLF injection, an attacker takes control of the response body to perpetrate the attack. For example, the CRLF might allow the attacker to do an XSS (cross-site scripting) attack by removing the CSP (content security policy) protection and injecting malicious JavaScript into the body.

How to fix

{% tabs crlf-injection %} {% tab crlf-injection generic %} To prevent a CRLF injection vulnerability, you should:

  • Not insert user input in the response headers.
  • Use a library method that properly encodes header values.

If your application needs to allow user input in a header, ensure the input only contains characters from a limited list, for instance, only alpha-numeric ones. {% endtab %}

{% endtabs %}