Header injection

From zakirkun/ice-tea · View interactive version

Header injection is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects user-controlled data written into HTTP response headers without CRLF stripping, enabling header injection and response splitting.

How to use this skill

Skill file

HTTP Header Injection / CRLF Injection

Overview

HTTP response header injection occurs when user-controlled data is placed in HTTP response headers without stripping carriage return (\r, %0d) and newline (\n, %0a) characters. This enables:

Detection Strategy

Look for response headers that include user input from request parameters or paths.

Remediation

Vulnerable (Python):

redirect_url = request.args.get('url')
response = make_response('', 302)
response.headers['Location'] = redirect_url  # CRLF injection!

Safe (Python):

import re
redirect_url = re.sub(r'[\r\n]', '', request.args.get('url', ''))
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.