type
Post
status
Published
date
Mar 10, 2026
slug
summary
简要介绍了CRLF注入漏洞的原理及利用方式。通过插入回车换行符(rn)实现对HTTP响应头和响应体的控制,并提供了相关的URL编码绕过技巧及修复建议。
tags
category
Web安全
icon
password

前言

当用户发送可控参数到服务器并服务器将参数输出在response headers中时,这时恶意用户可以通过插入换行符来欺骗造成response headers 和body可控,这就是CRLF漏洞
 
payload
\r\n 所对应的 url Encode为: %0d%0a =============>ascii码为0x0D0x0A=============>utf-8为: %E5%98%8A = %0A = \u560a ,%E5%98%8D = %0D = \u560d
%20 对应空格,%3b 对应;%3F对应%23对应#

案例

notion image
 

修复

过滤\r 、\n之类的换行符,避免输入的数据污染到其他HTTP头。

参考链接

 
The impact of CRLF injections vary and also include all the impacts of Cross-site S