Experiencing a Security Incident? → 24/7 Response: +91 73059 79248
Briskinfosec
COMPANY
About Briskinfosec Scope My Security Program Our Clients Testimonials Careers Partnership
INDUSTRIES
Banking & Financial Services Healthcare Manufacturing Government Energy & Utilities Telecom Technology Retail & E-Commerce All Industries →
CONNECT
Contact Us Request Assessment Responsible Disclosure Client Certificate Verification Training Certificate Verification
SECURITY TESTING (VAPT)
Web Application VAPT Mobile App Security API Security Testing Cloud Security Assessment Network Security Audit IoT Penetration Testing OT/SCADA Security Database Penetration Wireless Security CREST VAPT
ADVANCED ASSESSMENT
Red Team Operations AI/LLM Security Audit Digital Forensics Cyber Intelligence Secure Code Review DevSecOps Hardware Security Thick Client Security Host Level Security Automotive VAPT Telecom VAPT
DATA & PRIVACY
Data Security Audit Data Privacy Audit Data Masking & Privacy DSPM Data Breach Simulation SBOM & SCA Website Security All Assurance Services →
COMPLIANCE FRAMEWORKS
ISO 27001:2022 SOC 2 PCI-DSS HIPAA GDPR DPDPA NIST CSF IRDAI ISO 22301 (BCP) ISO 42001 (AI) IEC 62443 (OT) ISO 21434 (Automotive) PDPL (Saudi)
GRC SERVICES
GRC Framework Cyber Risk Assessment Third-Party Risk (TPRM) Data Privacy Compliance Data Retention Policy National Security Compliance Cybersecurity Insurance All Compliance →
GOVERNANCE LAYER
Data Governance Security Posture Management Cybersecurity Maturity AI Maturity Assessment Cyber Resilience BCP/DR Planning vIT Compliance Business Impact Analysis
MANAGED SECURITY
Managed Security (MSSP) SOC as a Service V-CISO Incident Response Virtual Security Team Third Eye (Surveillance)
CONTINUOUS MONITORING
SOAR Integration Security Monitoring Threat Intelligence Platform Cyber Threat Intelligence Lateral Movement Detection Penetration Test as Service
DEFENSIVE OPS
Perimeter Security Access Control Review Cloud Config Review CDN Security Network Architecture Cloud Security Management Virtualization Security All MSSP Services →
ELITE ASSESSMENTS
Threat Modeling Ransomware Readiness Threat & Vulnerability Mgmt Military Grade Review Hacker's POV Assessment
HUMAN LAYER
Security Awareness Training Phishing Simulation Tabletop Exercise Secure Code Training Cybersecurity Culture Cybersec Leadership Incident Response Training Data Privacy Training
STRATEGIC SERVICES
Application Security Governance Quarterly AppSec Review Minimum Security Baseline Secure SDLC Cyber Sense Plan Integration Threat Analysis Infra Risk Assessment Web Extensions Security bSAFE Security Score Layered Security Philosophy All Maturity Services →
PLATFORMS
LURA Portal LuraInsight (SAST) bSAFE Score BriskBox All Products →
Staffing
LEARN
Blog Videos Case Studies Press Room
INTELLIGENCE
Threatsploit Reports Security Essentials Carousel Flyers & Downloads All Resources →
Briskinfosec is a CREST accredited cybersecurity firm, globally recognized for penetration testing and VAPT services Briskinfosec is a CERT-In empanelled cybersecurity company based in Chennai with global operations in Dubai
Get Your bSafe Score →
Briskinfosec
COMPANY
About Briskinfosec Scope My Security Program Our Clients Testimonials Careers Partnership
INDUSTRIES
Banking & Financial Services Healthcare Manufacturing Government Energy & Utilities Telecom Technology Retail & E-Commerce All Industries →
CONNECT
Contact Us Request Assessment Responsible Disclosure Client Certificate Verification Training Certificate Verification
SECURITY TESTING (VAPT)
Web Application VAPT Mobile App Security API Security Testing Cloud Security Assessment Network Security Audit IoT Penetration Testing OT/SCADA Security Database Penetration Wireless Security CREST VAPT
ADVANCED ASSESSMENT
Red Team Operations AI/LLM Security Audit Digital Forensics Cyber Intelligence Secure Code Review DevSecOps Hardware Security Thick Client Security Host Level Security Automotive VAPT Telecom VAPT
DATA & PRIVACY
Data Security Audit Data Privacy Audit Data Masking & Privacy DSPM Data Breach Simulation SBOM & SCA Website Security All Assurance Services →
COMPLIANCE FRAMEWORKS
ISO 27001:2022 SOC 2 PCI-DSS HIPAA GDPR DPDPA NIST CSF IRDAI ISO 22301 (BCP) ISO 42001 (AI) IEC 62443 (OT) ISO 21434 (Automotive) PDPL (Saudi)
GRC SERVICES
GRC Framework Cyber Risk Assessment Third-Party Risk (TPRM) Data Privacy Compliance Data Retention Policy National Security Compliance Cybersecurity Insurance All Compliance Services →
GOVERNANCE LAYER
Data Governance Security Posture Management Cybersecurity Maturity AI Maturity Assessment Cyber Resilience BCP/DR Planning vIT Compliance Business Impact Analysis
MANAGED SECURITY
Managed Security (MSSP) SOC as a Service V-CISO Incident Response Virtual Security Team Third Eye (Surveillance)
CONTINUOUS MONITORING
SOAR Integration Security Monitoring Threat Intelligence Platform Cyber Threat Intelligence Lateral Movement Detection Penetration Test as Service
DEFENSIVE OPS
Perimeter Security Access Control Review Cloud Config Review CDN Security Network Architecture Cloud Security Management Virtualization Security
ELITE ASSESSMENTS
Threat Modeling Ransomware Readiness Threat & Vulnerability Mgmt Military Grade Review Hacker's POV Assessment
HUMAN LAYER
Security Awareness Training Phishing Simulation Tabletop Exercise Secure Code Training Cybersecurity Culture Cybersec Leadership Incident Response Training Data Privacy Training
STRATEGIC SERVICES
Application Security Governance Quarterly AppSec Review Minimum Security Baseline Secure SDLC Cyber Sense Plan Integration Threat Analysis Infra Risk Assessment Web Extensions Security bSAFE Security Score → Layered Security Philosophy →
PLATFORMS
LURA Portal LuraInsight (SAST) bSAFE Score BriskBox All Products →
Staffing
LEARN
Blog Videos Case Studies Press Room
INTELLIGENCE
Threatsploit Reports Security Essentials Carousel Flyers & Downloads All Resources →
Home → Blog → CRLF Injection Attack
Web Application Security

CRLF Injection Attack

May 28, 2019
7 min read
13,755 Views
Contents
CRLF Injection Attack

CONTENTS:

  • What is CRLF?
  • What is a CRLF injection vulnerability?
  • Reasons for CRLF injection
  • Impacts of CRLF injection
  • Scenarios of CRLF injection
  • Mitigations
  • Conclusion
  • How Briskinfosec helps you?
  • Curious to read our case study?
  • Last but not the least
  • You may be interested on

What is CRLF?

The term CRLF refers to Carriage Return (ASCII 13, , \r) Line Feed (ASCII 10, , \n). Carriage Return means the end of a line, and Line Feed refers to the new line. In more simple words, both of these are used to note the end of a line.

Whenever a user sends a request to a web server, the web server replies back with the response that contains both the HTTP headers and the actual website contents. The website contents are separated by a specific combination of special characters, that is carriage return and line feed simply known as the CRLF. The server knows, when a new header begins and ends with CRLF. This tells a web application or user where a new line begins, whether in a file, or in a text block.

These vary depending upon the operating systems:

In Windows, both a CR and LF are required to note the termination of a line whereas in Linux/UNIX, a LF is only required.

In the HTTP protocol, the CR-LF sequence is always used to terminate a line.

What is a CRLF injection vulnerability?

CRLF injection is carried out by an attacker by just simply inserting the carriage return line feed in the user input area to deceive the server or a web application, thus making them to think that an object is terminated and another new object has been started.

Reasons for CRLF injection:

This vulnerability arises very commonly in the HTTP request of web application that accepts the user supplied input from an untrusted source, without being properly validated for malicious character (CRLF).

Impacts of CRLF injection:

The impacts of CRLF injection varies and the risk depends upon the type of scenarios. CRLF Injection allows an attacker to inject client-side malicious scripts (E.g. Cross site scripting) to disclose information. An attacker can gain sensitive information like CSRF token and allow the attacker to set fake cookies. CRLF Injection enables an attacker to deactivate and bypass certain security restrictions like XSS filters and Same Origin Policy (SOP) in the victim’s browsers, making them susceptible to further malicious attacks as below:

  • Malicious Script Injection
  • Phishing Attacks
  • HTTP Header Injection
  • Client web browser cache poisoning
  • Client side session hijacking

Scenarios of CRLF injection:

Let’s see some scenarios of CRLF injection

Scenario 1: Client-Side Cookie Injection:

In this scenario, we can set a fake cookie value in to the application, which often leads to client-side cookie injection vulnerability.

image

Scenario 2: HTTP Header Injection:

In this scenario, we can set a new header value in the URL Parameter with some injected CRLF characters.

Here, (E.g. My_Header:New_Header_Value) we injected the header in the GET parameter of the request.

image

The server responds to the tampered request without restricting it, and prints the injected header in the server response. New Header is added like Pragma, Cache-Control, Last-Modified, and it may lead to cache poisoning attacks.

Scenario 3: In this scenario, we can probably inject and execute a malicious script in a redirection request combined with CRLF characters to bypass the filter and redirect the user to a malicious crafted website. Also, we’ll be able to run the malicious client-side javascript.

Here, we’ve injected the?Redir.php?c= parameter and through this, we would be able to inject a malicious URL (E.g. url=xssposed.org CRLF INJECTION XSS OPEN REDIRECT) followed with a malicious client side javascript (E.g. ).

image

The response shows that the original site gets redirected to the crafted fake website and alongside this, the injected malicious client-side JavaScript also gets processed by the server without validation and gets executed as shown in the above response.

Mitigations:

  • Effectively sanitize and validate the user supplied inputs.
  • Don’t let the supplied data by the user, directly reach into the response headers without validation. (E.g. StringEscapeUtils.escapeJava())
  • Use Functions that encodes the CR and LF special characters.
  • Encode the output in HTTP headers that are publicly visible to the users. Encoding prevents from getting affected by CRLF injection.

What Is HTTP Response Splitting?

An attacker can try to inject CRLF characters into the header and body of an HTTP response since they are separated by CRLF characters. The browser will know that the header ends and the body begins when you use CRLF.

This could lead to cross-site scripting (XSS) vulnerability since an attacker could add data into the response body where the HTML code is transmitted.

Eg: HTTP response splitting leading to XSS

Scenario 4:

Imagine an application that sets a custom header, for example:

  • Create a fake HTTP response header:0. Content-Length: As a result, the web browser treats this as a terminated answer and starts parsing a new one.
  • Add another fake HTTP response header: Content-Type: text/html. This is needed for the web browser to properly parse the content.
  • Add page content with an XSS:

image

Conclusion:

Application developers should take excessive care and think in the mindset of a hacker. This will help them to create a secure application. In the Application security aspect, the user supplied input should not be trustable and it must be validated properly before accepting it into the application. We must possess good development practices coupled with security methodologies to preserve ourselves from worldly threats.

How Briskinfosec helps you?

Briskinfosec provides top notch web application security assessments and assesses the entire attack surfaces. Pertaining to this, we vigorously validate the user inputs and if any malicious or strange inputs are discovered, we block them. We completely encode the output in HTTP headers, blinding those to the eyes of intruders. Further, we also provide practical awareness on all possible web application issues.

Curious to read our case studies?

Our stakeholder, one of the unique HR solution providers, wanted us to perform an effective security assessment on their web applications. While doing security assessment on their entire web applications, we were able to identify many vulnerabilities including CRLF, then eliminated them, and strengthened their security environment. Check out our case study to know it fully.

Last but not the least:

There are always two ways or more than that to procure many things that we want. For example, to travel towards a place, it can be done through bare foot while the other, through online vehicle booking. To book a movie ticket, it can be done through reaching the spot and then booking while the other can be done through online booking. In both these cases, the former is tiresome while the latter is awesome as the latter saves time and is the easier way to get the job done.

Similarly, Briskinfosec creates Threatsploit Adversary report on a monthly basis. It’s a report that contains the occurrence of global cyberattacks, its causes, its impacts and much more. Instead of looking in search engines and websites about the worldwide cyber breaches and others, just a single click on our report is enough. It will enamor you!

You may be interested on:

Cyber Security Products Vs Cyber Security Services

Getting Started with Frida

Top Trending Web app security Vulnerabilities

Are you still fighting against decade old application attacks?

 

Web Application Security Website Security Information Security
Share this article
A
Written by
Arulselvar Thomas Founder & Director
Cybersecurity expert at Briskinfosec Technology and Consulting, specializing in security assessments, compliance, and helping organizations build resilient security postures.
Recent Blogs
How to Create a Secure AWS IAM Audit User for Cloud Security Assessments
The Cyber Capability Gap Between Mythos, GPT-5.5 and Open-Weight Models Explained
Inside Claude Mythos and What the Indian Defender Actually Needs to Know
Related Services
VAPT Cloud Security Red Team Network Security API Security Mobile App Security
Latest Videos
Navigating Compliance in Cybersecurity Laws, Privacy laws and Your Business
Navigating Compliance in Cybersecurity Laws,...
Apr 26, 2024
Beyond Size: How to Elevate your SOC Cybersecurity Monitoring
Beyond Size: How to Elevate your SOC Cybersec...
Mar 20, 2024
Red Team Assessment
Red Team Assessment
Mar 13, 2024
Get Protected

Discuss your security posture with our certified experts. Get a free initial assessment.

Schedule Free Consultation WhatsApp Us

Related Articles

The Evolving Role of the CISO From Technical Expert to Strategic Advisor
The Evolving Role of the CISO From Technical Expert to Strategic Advisor
Aug 21, 2025 · 1,119
When Seconds Count Rethinking Incident Response in the Age of AI-Powered Attacks
When Seconds Count Rethinking Incident Response in the Age of AI-Powered Attacks
Jul 18, 2025 · 2,265
AI in Cybersecurity Separating Hype from Reality for CISOs
AI in Cybersecurity Separating Hype from Reality for CISOs
Jul 17, 2025 · 1,868
Read Next (Top Blog)
Getting Started with Frida

Ready to Strengthen Your Security?

Talk to our CREST-certified security experts today

WhatsApp Us
Chat instantly with our security team
AI Presales Bot
Get instant answers from LURA AI
Schedule Consultation
Book a free security consultation
Email Us
contact@briskinfosec.com
Link copied to clipboard!
About Us
About Briskinfosec Certin Our Clients Testimonials Press Room
Services
Application Security Mobile App Security Cloud Security Red Team Operations SOC as a Service MSSP All Services →
Compliance
ISO 27001 SOC 2 PCI-DSS GDPR HIPAA All Compliance →
Resources
Blog Videos Case Studies Threatsploit Reports All Resources →
Connect
Careers Partnership Contact Us Responsible Disclosure Terms and Conditions Privacy Policy
India (HQ) Bascon Futura Sv It Park, 12th Floor, 10/2,
Venkatanarayana Rd, T. Nagar, Chennai, Tamil Nadu 600017
+91 73059 79248 · contact@briskinfosec.com
UAE (Dubai) IFZA Business Park, Building A1, Dubai Digital Park,
Dubai Silicon Oasis, Post Box 342001, UAE
contact@briskinfosec.com
Briskinfosec CREST accredited cybersecurity company and globally recognized provider of penetration testing and VAPT services CERT-In empanelled cybersecurity company with headquarters in Chennai and operations in Dubai offering VAPT services Briskinfosec ISO 27001 certified company ensuring robust information security management system Briskinfosec ISO 9001:2015 certified cybersecurity company committed to quality management in India Briskinfosec is a DUNS registered cybersecurity company with a verified global business identity offering VAPT services
© 2026 Briskinfosec Technology & Consulting Pvt Ltd. All rights reserved.
Scope Your Security Program
Chat on WhatsApp Ask LURA AI AI