header-injection

Strip CRLF sequences from user-derived HTTP header values before assignment.

20|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/thejefflarson/soundcheck --skill header-injection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: header-injection
Source: https://github.com/thejefflarson/soundcheck/tree/main/.claude/skills/header-injection
Command: npx skills add https://github.com/thejefflarson/soundcheck --skill header-injection

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protects against HTTP response header injection where user input containing CRLF characters is included in response headers, allowing attackers to inject arbitrary headers or split the HTTP response.

Core Features & Use Cases

  • Strips CRLF sequences from user-derived header values before they are set in responses.
  • Sanitizes forwarded and request-derived headers to prevent header-based data leakage.
  • Enforces safe encoding for Content-Disposition filenames and Location headers to prevent injection.
  • Provides verification guidance to ensure all header-setting code paths are protected.

Quick Start

Scan your codebase for all places that set response headers from user input and apply the sanitization guidance.

Frequently Asked Questions about header-injection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent HTTP header injection from user input in my web API?

Prevent HTTP header injection by sanitizing CRLF characters from user input before assigning values to response headers. Stripping carriage return and line feed sequences stops attackers from injecting arbitrary headers or splitting HTTP responses in web servers and API backends.

What is HTTP response splitting and how does CRLF injection work?

HTTP response splitting occurs when CRLF injection allows attackers to insert carriage return and line feed characters into response headers. This breaks the HTTP response boundary, enabling the injection of malicious headers or body content through unsanitized user-derived header values.

How do I sanitize Content-Disposition and Location headers safely?

Sanitize Content-Disposition and Location headers by enforcing safe encoding practices and stripping CRLF sequences from all input values. This prevents header injection when setting response headers dynamically from request parameters or external data sources.

Do I need to sanitize request-derived headers to prevent data leakage?

Yes, sanitize forwarded and request-derived headers to prevent header-based data leakage. Removing CRLF sequences from these values before they are included in response headers mitigates both injection attacks and unintended exposure of sensitive header data.

What is the best way to find vulnerable header-setting code paths?

Scan your codebase for all places that set response headers from user input, request parameters, or external data, then apply CRLF sanitization guidance to each location. Verify that every header-setting code path enforces safe value handling and proper encoding.