CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-9W88-79F8-M3VP

GHSA-9W88-79F8-M3VP: Insecure Trailer Handling Allows HTTP Header Injection in ewe

Alon Barad
Alon Barad
Software Engineer

Mar 17, 2026·7 min read·22 visits

Executive Summary (TL;DR)

The ewe library incorrectly permitted trailing HTTP headers to overwrite primary request headers due to a permissive denylist. Attackers could exploit this to forge sensitive headers like Authorization or Cookie, bypassing security controls. The issue is resolved in version 3.0.5 by implementing a strict allowlist.

The ewe web server library for Gleam/Erlang contains a moderate-severity vulnerability in its HTTP/1.1 chunked transfer encoding parser. Prior to version 3.0.5, the library utilized an incomplete denylist for processing HTTP trailer headers, enabling attackers to inject or overwrite critical request headers such as Authorization, Cookie, or X-Forwarded-For. This flaw allows for potential authentication bypass, session hijacking, or identity spoofing depending on the specific application logic deployed atop the library.

Vulnerability Overview

The ewe package is a web server library designed for the Gleam and Erlang ecosystems. It handles raw HTTP connection parsing, request routing, and response generation. The vulnerability resides within the library's HTTP/1.1 parsing module, specifically in the routines responsible for handling chunked transfer encoding.

Chunked transfer encoding is a mechanism that allows a server or client to send a data stream in multiple parts without knowing the total content length upfront. The HTTP/1.1 specification allows senders to append "trailer" headers after the final zero-length chunk. These trailers are typically used for metadata generated during the transmission of the body, such as cryptographic checksums or routing diagnostics.

The ewe implementation failed to properly constrain which headers could be supplied in this trailer section. The library categorized incoming trailer fields using a permissive denylist, classified under CWE-184 (Incomplete List of Disallowed Inputs). This architectural decision exposed the server to header injection attacks, where malicious actors could manipulate the internal state of the request object before it reached the application routing layer.

The impact of this flaw is highly dependent on the upstream application architecture. Applications relying on the web framework to validate standard headers for authentication, authorization, or client identification are directly exposed to bypass attacks. By overwriting key headers from the trailer, an attacker controls the security context evaluated by the application.

Root Cause Analysis

The root cause of this vulnerability stems from the combination of an incomplete denylist and a permissive header merging strategy. In the src/ewe/internal/http.gleam module, the handle_trailers function is responsible for parsing headers sent after the final chunk. The original implementation attempted to block dangerous headers using the is_forbidden_trailer function.

The is_forbidden_trailer function explicitly blocked only nine standard headers: transfer-encoding, content-length, host, cache-control, expect, max-forwards, pragma, range, and te. Any header not explicitly listed in this function was deemed acceptable. This implementation directly violates the principle of fail-safe defaults, as the HTTP specification contains numerous headers with severe security implications that were omitted from this list.

Once a trailer header bypassed the denylist check, the library invoked request.set_header(req, field, value). In the Gleam HTTP package, set_header is a destructive operation that replaces any existing header with the same name. It does not append the value or isolate the trailer metadata into a separate namespace.

Because of this design, the web server processes the initial request headers, establishes the request context, and then subsequently parses the chunked body. When the parser reaches the trailer section, it systematically overwrites the previously established headers with any attacker-supplied values that bypass the flawed denylist. The resulting manipulated request object is then passed to the user-defined application handlers.

Code Analysis

An examination of the vulnerable code reveals the exact mechanism of the bypass. The initial implementation relied on pattern matching against a hardcoded list of forbidden strings. This approach required the maintainers to exhaustively enumerate every standard and non-standard header that could influence application behavior.

fn is_forbidden_trailer(field: String) -> Bool {
  case string.lowercase(field) {
    "transfer-encoding"
    | "content-length"
    | "host"
    | "cache-control"
    | "expect"
    | "max-forwards"
    | "pragma"
    | "range"
    | "te" -> True
    _ -> False
  }
}

The fix, introduced in commit 94ab6e7bf7293e987ae98b4daa51ea131c2671ba, replaces the denylist with a strict allowlist. The maintainers discarded the is_forbidden_trailer function and implemented is_allowed_trailer. This forces a positive security model where only explicitly permitted metadata headers are merged into the main request object.

fn is_allowed_trailer(field: String) -> Bool {
  case field {
    "server-timing" | "content-digest" | "repr-digest" -> True
    _ -> False
  }
}

The patched logic restricts trailer merging to exactly three low-risk headers. These headers are exclusively used for diagnostic timing or payload integrity verification. By explicitly dropping all other trailer fields, the parser successfully isolates the primary request context from any trailing data, neutralizing the injection vector.

Exploitation Methodology

Exploiting this vulnerability requires sending a carefully structured HTTP request using chunked transfer encoding. The attacker must first declare their intention to send a specific trailer header by including the Trailer header in the initial request block. The HTTP specification mandates this declaration, and many parsers require it to correctly process trailing fields.

The attacker constructs the payload by dividing the request body into chunks. The sensitive header target, such as Authorization, is transmitted after the zero-length chunk that signals the end of the HTTP body. The network transmission proceeds in a single TCP stream, but the parser processes the payload sequentially.

POST /api/admin-action HTTP/1.1
Host: target.example.com
Transfer-Encoding: chunked
Trailer: Authorization
Content-Type: application/json
 
11
{"action":"drop"}
0
Authorization: Bearer admin_token_here
 

> [!NOTE] > The trailing line breaks after the injected header are critical. The server must recognize the end of the trailer section to complete the parsing operation and forward the request to the application layer.

When the ewe server parses this transmission, it initially sees no Authorization header or a legitimate, low-privileged one. As it consumes the chunked body, it reaches the 0 chunk and begins parsing the trailers. The parser encounters the Authorization header, passes it through the incomplete denylist, and calls set_header. The application logic subsequently evaluates the attacker-supplied admin_token_here as the definitive authentication context.

Impact Assessment

The impact of this vulnerability is inherently contextual, dictated by the security posture of the downstream application. However, because the vulnerability allows arbitrary manipulation of primary request headers, the theoretical impact floor is high. Applications that rely on header values for critical state management are severely compromised.

The most prominent risk is authentication bypass. If an application uses bearer tokens or session IDs passed via headers, an attacker can supply an unauthenticated request initially, satisfying edge-level checks, and then inject a privileged token in the trailer. This effectively subverts identity verification controls operating before the full request body is parsed.

Another significant risk vector involves IP spoofing and rate-limit evasion. Load balancers and reverse proxies typically append metadata headers like X-Forwarded-For or X-Real-IP to identify the originating client. By injecting these headers in the trailer section, an attacker can overwrite the values provided by the proxy infrastructure. This allows the attacker to mimic internal network traffic or rotate apparent IP addresses to bypass volumetric defenses.

The severity is amplified by the fact that this exploitation occurs pre-routing. The malicious modifications happen entirely within the internal ewe HTTP parser before any application-level middleware or business logic is executed. Developers auditing their application code would see no obvious flaws, as the injected headers appear completely indistinguishable from legitimate client input.

Remediation and Mitigation

The definitive remediation for this vulnerability is upgrading the ewe library to version 3.0.5 or later. The patch completely removes the vulnerable denylist implementation and substitutes a strict allowlist. This positive security model prevents any arbitrary header from being processed in the trailer section, fundamentally closing the attack vector.

For systems where immediate patching is not technically feasible, operators must implement compensating controls at the network edge. Reverse proxies or Web Application Firewalls (WAFs) can be configured to strip the Trailer header from incoming requests. Alternatively, edge infrastructure can be configured to reject chunked HTTP requests entirely if the application API does not require streaming data ingest.

Developers using ewe should systematically review their dependency trees to ensure the vulnerable package version is not transitively included. Verification involves checking the gleam.toml manifest file and confirming that the resolution lockfile enforces the fixed version. Post-upgrade, no application code modifications are required, as the fix operates transparently within the library's internal parser.

Official Patches

eweOfficial Release v3.0.5 containing the fix

Fix Analysis (2)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Affected Systems

ewe web server libraryGleam ecosystemErlang ecosystem

Affected Versions Detail

Product
Affected Versions
Fixed Version
ewe
vshakitskiy
< 3.0.53.0.5
AttributeDetail
CWE IDCWE-184
Attack VectorNetwork
CVSS v3.1 Score6.5
ImpactHeader Injection / Authentication Bypass
Exploit Statuspoc
CISA KEVFalse

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1550Use Alternate Authentication Material
Defense Evasion
CWE-184
Incomplete List of Disallowed Inputs

The product relies on a list of inputs that are not allowed, but the list is incomplete, allowing an attacker to bypass intended restrictions.

Vulnerability Timeline

Initial trailer handling logic introduced with vulnerable denylist.
2025-08-31
Initial reports of infinite loops in trailer handling led to vulnerability discovery.
2026-03-13
Vulnerability addressed by implementing a strict allowlist (Commit 94ab6e7b).
2026-03-14
v3.0.5 released.
2026-03-14
GHSA-9W88-79F8-M3VP advisory published.
2026-03-14

References & Sources

  • [1]GitHub Advisory: GHSA-9W88-79F8-M3VP
  • [2]ewe Fix Commit: Strict Allowlist
  • [3]ewe Initial Commit: Insecure Denylist

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•33 minutes ago•CVE-2026-55391
7.5

CVE-2026-55391: Server-Side Request Forgery Bypass via DNS Rebinding in datamodel-code-generator

CVE-2026-55391 is a server-side request forgery (SSRF) bypass vulnerability in the datamodel-code-generator package. The vulnerability occurs due to a Time-of-Check to Time-of-Use (TOCTOU) race condition during DNS resolution, combined with a failure to inspect embedded IPv4-in-IPv6 address mappings. By deploying a malicious DNS server with a low Time-To-Live (TTL) configuration, an attacker can bypass private address blocklists and coerce the application to connect to internal services or local endpoints.

Alon Barad
Alon Barad
0 views•6 min read
•about 2 hours ago•CVE-2026-54653
8.8

CVE-2026-54653: Remote Code Execution via Code Injection in datamodel-code-generator

A critical code injection vulnerability exists in datamodel-code-generator from version 0.17.0 up to 0.60.1. The vulnerability allows remote attackers who supply a malicious JSON schema to execute arbitrary Python code. This occurs when the schema specifies a payload inside the 'default_factory' field extra, which is rendered directly into generated code without sanitization. When downstream processes load or import the output code, the evaluation of the class definition immediately triggers the execution of the injected code.

Alon Barad
Alon Barad
2 views•7 min read
•about 3 hours ago•CVE-2026-55389
7.5

CVE-2026-55389: Path Traversal and Security Control Bypass in datamodel-code-generator via Scheme Reference Resolution

An arbitrary local file read and path traversal bypass vulnerability in datamodel-code-generator before version 0.62.0 allows unauthenticated remote attackers to read arbitrary files via crafted JSON-Schema $ref references using the file:// scheme or directory traversal sequences.

Amit Schendel
Amit Schendel
3 views•4 min read
•about 4 hours ago•CVE-2026-54654
7.8

CVE-2026-54654: Python Code Injection in datamodel-code-generator via Comment Line-Break Escape

A vulnerability in the datamodel-code-generator library allows for unauthenticated remote code execution when generating code from malicious or untrusted schema specifications. By embedding special physical line terminators, such as carriage returns, vertical tabs, or form feeds, within template values, an attacker can break out of inline Python comment boundaries. The generated output file subsequently contains un-commented python instructions that execute automatically during module import.

Amit Schendel
Amit Schendel
6 views•5 min read
•about 5 hours ago•CVE-2026-62325
9.1

CVE-2026-62325: Authentication Bypass in goshs SFTP Server via Missing Password Check

A critical authentication bypass vulnerability in the SFTP server module of goshs version 2.1.3 allows remote, unauthenticated attackers to read, write, modify, or delete files on the target hosting environment. This vulnerability is caused by an incomplete logic check during initialization that falls back to a password-less configuration when an empty password string is specified.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 6 hours ago•CVE-2026-64863
9.1

CVE-2026-64863: WebDAV MOVE Bypass of --no-delete and --upload-only Restrictive Policies in goshs

An access control bypass vulnerability in goshs prior to version 2.1.4 allows unauthenticated remote attackers to bypass security flags intended to prevent file deletion and unauthorized modification. By exploiting the server's incorrect classification of WebDAV MOVE and overwriting COPY methods, attackers can execute arbitrary file deletion and data manipulation on the host system.

Amit Schendel
Amit Schendel
4 views•10 min read