cwe-113-http-response-splitting

Sanitizes Java HTTP headers and cookies to prevent CWE-113 CRLF injection.

3|1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-113-http-response-splitting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cwe-113-http-response-splitting
Source: https://github.com/DevelopersCoffee/java-cwe-security-skills/tree/main/cwe-113-http-response-splitting
Command: npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-113-http-response-splitting

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the critical security vulnerability of HTTP Response Splitting in Java applications, preventing attackers from injecting malicious content into HTTP headers.

Core Features & Use Cases

  • Vulnerability Remediation: Provides deterministic code transformations to fix CWE-113.
  • Header Sanitization: Implements secure methods for handling user input in HTTP headers and cookies.
  • Use Case: When a SAST tool flags a response.addHeader("Location", redirectUrl) line where redirectUrl comes from user input, use this skill to automatically apply the secure, sanitized version.

Quick Start

Use the cwe-113-http-response-splitting skill to sanitize user input in HTTP headers.

Frequently Asked Questions about cwe-113-http-response-splitting

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

FAQPage Schema
How do I remediate CWE-113 HTTP Response Splitting in Java code?

To remediate CWE-113 HTTP Response Splitting in Java code, sanitize user-controlled input used in HTTP headers and cookies by applying strict input validation and output encoding to prevent CRLF injection.

What is HTTP Response Splitting and how does CRLF injection affect web applications?

HTTP Response Splitting is a vulnerability where attackers inject malicious content into HTTP headers via CRLF injection. It affects web applications by allowing the attacker to manipulate the response body or headers.

How do I sanitize user input used in Java HTTP response headers and cookies?

Sanitize user input in Java HTTP response headers and cookies by validating the data against strict whitelists and encoding output. This prevents unauthorized carriage return and line feed characters from being interpreted.

Can I automatically fix a SAST flagged response.addHeader vulnerability in Java?

Yes, you can automatically fix a SAST flagged response.addHeader vulnerability by applying deterministic code transformations that replace unvalidated user input with secure, sanitized header manipulation methods.

When do I need to validate input for HTTP Response Splitting vulnerabilities?

You need to validate input for HTTP Response Splitting vulnerabilities whenever your Java web application performs direct manipulation of HTTP response headers or cookies using data originating from user-controlled sources.

What is the best way to prevent CRLF injection in Java web frameworks?

The best way to prevent CRLF injection in Java web frameworks is to implement robust header sanitization methods that strip or encode CR and LF characters from user-supplied strings before adding them to HTTP responses.