CRLF Injection

By
Rejah Rehim
Published on
19 Jun 2018
Vulnerability
Injection
CRLF

Carriage Return and Line Feed Injection (CRLF) is a type of injection attack that can cause Cross-site Scripting (XSS) attacks. This can also cause web cache poisoning among others. This server is vulnerable to Carriage Return and Line Feed Injection. This is because the server fails to properly escape/remove CRLF characters in the user’s inputs. This vulnerability leads to various attacks including web cache poisoning, cross user defacement, hijacking pages with sensitive user information and cross-site scripting.

Example

The below URL has been split response header.

http://www.example.beaglesecurity.com/randompage.php?page=%0d%0aContent-Type: text/html%0d%0aHTTP/1.1 200 OK%0d%0aContent-Type: text/html%0d%0a%0d%0a%3Cscript%3Ealert(1)%3C/script%3E

The user will see the following

        <script>alert(10)</script>

    

Impact

The vulnerabilities include :-

  • Web cache poisoning
  • cross-user defacement
  • Cross-site scripting

Mitigation / Precaution

Beagle recommend the following fixes:-

  • restrict CR(0x13) and LF(0x10) from the user input
  • Properly encode the output in order to prevent the injection of custom HTTP headers

Written by
Rejah Rehim
Rejah Rehim
Co-founder, Director
Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 10 days