Skip to main content

CVE-2026-34715

MEDIUM
HTTP Response Splitting (CWE-113)
2026-04-01 https://github.com/vshakitskiy/ewe GHSA-x2w3-23jr-hrpf
5.3
CVSS 3.1 · NVD
View

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization HTTP response header sanitization
Impact

This vulnerability presents moderate real-world risk aligned with its CVSS 5.3 (Medium) base score. The CVSS vector AV:N/AC:L/PR:N/UI:N/S:U indicates network attack vector, low attack complexity, no authentication required, and no user interaction - all factors enabling easy exploitation. However, successful exploitation requires that the ewe application explicitly passes unsanitized user input into response header values, which is a common but not universal pattern (e.g., custom redirect URLs, user-supplied header values). The EPSS score and active exploitation status are not provided in the input data. The vulnerability is not listed in CISA KEV, and no independent public exploit code is documented in the references provided, suggesting it is not currently confirmed as actively exploited in the wild. The integrity impact is limited (I:L) - an attacker can inject headers and response content but cannot leak sensitive data or execute code on the server itself, though injected content (malicious JavaScript via Set-Cookie or Location headers) could affect downstream clients. The lack of confidentiality and availability impact, combined with the requirement for unsafe application coding patterns, places this below critical severity despite its trivial execution. Organizations running ewe applications that reflect user input into response headers face real risk; those using ewe in configurations that only set static or framework-controlled response headers face minimal risk.

Exploit ScenarioDerived

An ewe application provides a redirect endpoint that reads a 'next' query parameter and sets it as the Location header value without validation, as shown in the proof-of-concept code. An attacker crafts a request to /?next=https://example.com%0d%0aX-Injected:%20true (URL-decoded to https://example.com\r\nX-Injected: true) and sends it to the server. The encode_headers function embeds this value directly into the response HTTP bytes, creating a structurally valid HTTP response with an injected X-Injected: true header following the Location header. The attacker can further abuse this to inject Set-Cookie headers for session fixation, Location headers for phishing redirects, or Content-Length/Transfer-Encoding headers for cache poisoning attacks against downstream proxies or CDNs.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 01, 2026

HTTP response splitting in ewe's encode_headers function allows remote attackers to inject arbitrary HTTP response headers and content by embedding CRLF sequences in user-controlled response header values, enabling cache poisoning and cross-site scripting attacks. The vulnerability affects ewe versions that do not validate outgoing response header keys and values, despite implementing equivalent validation for incoming request headers. A proof-of-concept demonstrates injection of custom headers through a redirect URL parameter passed directly to the Location header without sanitization.

RemediationAI

Apply the vendor-released patch by upgrading ewe to the patched version once released by the ewe maintainers; consult the GitHub advisory at https://github.com/vshakitskiy/ewe/security/advisories/GHSA-x2w3-23jr-hrpf for the specific patched version number and release date. The primary fix is to add CRLF validation to the encode_headers function in src/ewe/internal/encoder.gleam, mirroring the existing validate_field_value() function used for incoming request headers. Specifically, header keys and values must be stripped of or rejected if they contain \r (0x0D) or \n (0x0A) bytes before being embedded into the BitArray output. As a temporary mitigation prior to patching, applications should implement application-level validation: sanitize all user-supplied data before passing it to response.set_header() by removing or rejecting any string containing CRLF sequences, and prefer static or framework-controlled header values over user-supplied ones. Developers should also audit all response header assignments in their ewe applications to identify code paths that accept user input.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The ewe web framework (Erlang package) contains an HTTP/1.1 encoder in src/ewe/internal/encoder.gleam that constructs response headers by directly interpolating header keys and values into raw HTTP byte sequences (BitArray) without stripping or validating CRLF characters (\r\n, bytes 0x0D and 0x0A). The root cause is CWE-113 (Improper Neutralization of CRLF Sequences in HTTP Headers), a classic HTTP injection vulnerability. The encode_headers function concatenates user-supplied strings into the BitArray format using UTF-8 encoding without any character validation: <<acc:bits, key:utf8, ": ", value:utf8, "\r\n">>. This directly mirrors the structure of HTTP/1.1 header syntax, so if an attacker controls a header value and embeds \r\n, they can prematurely terminate the current header line and inject additional headers or even a complete second HTTP response. Notably, ewe's HTTP/1.1 request parser (src/ewe/internal/http1.gleam) implements validate_field_value() to sanitize incoming request headers, creating an asymmetric validation posture where inbound requests are protected but outbound responses are not.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

DescriptionNVD

Summary

The encode_headers function in src/ewe/internal/encoder.gleam directly interpolates response header keys and values into raw HTTP bytes without validating or stripping CRLF (\r\n) sequences. An application that passes user-controlled data into response headers (e.g., setting a Location redirect header from a request parameter) allows an attacker to inject arbitrary HTTP response content, leading to response splitting, cache poisoning, and possible cross-site scripting.

Notably, ewe *does* validate CRLF in incoming request headers via validate_field_value() in the HTTP/1.1 parser - but provides no equivalent protection for outgoing response headers in the encoder.

Details

File: src/ewe/internal/encoder.gleam

Vulnerable code:

gleam
fn encode_headers(headers: List(#(String, String))) -> BitArray {
  let headers =
    list.fold(headers, <<>>, fn(acc, headers) {
      let #(key, value) = headers
      <<acc:bits, key:utf8, ": ", value:utf8, "\r\n">>
    })

  <<headers:bits, "\r\n">>
}

Both key and value are embedded directly into the BitArray output. If either contains \r\n, the resulting bytes become a structurally valid but attacker-controlled HTTP response, terminating the current header early and injecting new headers or a second HTTP response.

Contrast with request parsing (src/ewe/internal/http1.gleam): incoming header values are protected:

gleam
use value <- try(
  validate_field_value(value) |> replace_error(InvalidHeaders)
)

No analogous validation exists for outgoing header values in the encoder. The solution is to strip or reject \r (0x0D) and \n (0x0A) from all header key and value strings in encode_headers before encoding, mirroring the validation already applied to incoming request headers via validate_field_value()

PoC

An ewe application echoes a user-supplied redirect URL into a Location header:

gleam
fn handle_request(req: Request) -> Response {
  let redirect_url =
    request.get_query(req)
    |> result.try(list.key_find(_, "next"))
    |> result.unwrap("/home")

  response.new(302)
  |> response.set_header("location", redirect_url)
  |> response.set_body(ewe.Empty)
}

Attacker request:

bash
printf 'GET /?next=https://example.com%%0d%%0aX-Injected:%%20true HTTP/1.1\r\nHost: localhost\r\n\r\n' | nc -w 2 localhost 8080

Resulting response:

HTTP/1.1 302 Found
location: https://example.com
X-Injected: true
content-length: 0
date: Tue, 24 Mar 2026 07:53:00 GMT
connection: keep-alive

The X-Injected: true header appears as a separate response header, confirming that CRLF sequences in user input are not sanitized by the encoder.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)NVD

pkg:erlang/ewe

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy