CRLF Injection漏洞是利用url里传\r\n字符(CRLF),篡改http请求头。http请求是按照两个CRLF来区分头和体的。
如果请求地址是如下:
http://test.com/index.php?url=www.pgres.cn%0d%0a%0d%0a<img src=1 onerror=alert(/xss/)>
后台接收url参数进行跳转
header('Location:'.$url);
这样就会造成xss攻击。
防御方法是过滤\r\n字符。
但是目前php7,这样执行会出现错误: Header may not contain more than a single header, new line detected。貌似已经处理了这种攻击?