InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

🚨CRLF Injection: Guide to Finding & Exploiting Vulnerabilities

Abhijeet Kumawat
InfoSec Write-ups
Published in
4 min readMar 18, 2025

Free Article Link

Hello, cybersecurity enthusiasts! 👋 In this comprehensive guide, we’re diving deep into CRLF Injection — what it is, why it’s dangerous, and how to find and exploit it like a pro. Whether you’re a bug bounty hunter, a penetration tester, or a developer, this is a must-read! Let’s get started!

Generated by DALL.E

🎯 What is CRLF Injection?

CRLF (Carriage Return Line Feed) Injection is a web security vulnerability that allows attackers to inject Carriage Return (CR) and Line Feed (LF) characters into web application inputs. These characters are used to signify the end of a line in text-based protocols such as HTTP.

🔍 Why is it Dangerous?

CRLF injection can be used for:

  • HTTP Response Splitting: Split a single HTTP response into two, allowing attackers to control the second response (e.g., malicious redirects or XSS).
  • Log Poisoning: Inject fake entries into server logs to cover tracks or trigger false alerts.
  • XSS Escalation: Bypass sanitization by injecting HTML/JavaScript via headers.
  • Email Header Injection: Manipulate email headers (e.g., BCC attackers in password reset emails).

🔑 CRLF Breakdown: What are CR and LF?

  • CR (Carriage Return): ASCII code 13 or \r
  • LF (Line Feed): ASCII code 10 or \n

Together, they form a new line (\r\n) in many operating systems and protocols. In the context of HTTP, they’re used to separate headers from the body.

đź“š CRLF 101: Breaking Down the Basics

🔍 How CRLF Works in HTTP Headers

A normal HTTP response looks like this:

HTTP/1.1 200 OK  
Content-Type: text/html
Set-Cookie: session=abc123

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by Abhijeet Kumawat

Radhe Radhe ✨ || Jr. Security Consultant || Security Researcher || Bug Hunter || Web Application Penetration Tester || Ethical Hacker ||

No responses yet

Write a response