Research/CVE-2025-12543

When 403 Turns Into 200 — Host Header Normalization Bugs in WildFly / Undertow

A framework-level security issue in WildFly's Undertow HTTP server where malformed Host headers lead to inconsistent security decisions and host-based access control bypass.

CWE
CWE-20
Vendor
WildFly / Undertow
Component
Host header parsing
Disclosed
Jan 2026

TL;DR

Malformed Host headers that should be rejected early are instead accepted and processed by WildFly.
While this may initially appear to be an RFC compliance issue, it actually introduces a security boundary inconsistency that can be abused to turn upstream 403 Forbidden responses into backend 200 OK responses in real-world deployments.

Background

The Host header is a security-critical input.

In modern Java application servers like WildFly, it commonly influences:

  • Virtual host routing
  • Host-based access controls
  • Security constraints
  • Reverse proxy and trust boundaries

Any inconsistency in how this header is parsed, normalized, or validated can directly affect authorization decisions.

The Issue

In a default WildFly deployment using its embedded Undertow HTTP server, malformed Host headers are accepted instead of being rejected with 400 Bad Request.

Examples include:

  • Invalid port suffixes
  • Trailing whitespace
  • Empty Host headers
  • Multiple Host headers in a single request

In all tested cases, WildFly responds with 200 OK.

Proof of Concept

The following examples were tested against a vanilla WildFly deployment using the official Docker image.

1. Invalid Port Suffix in Host Header

bash
curl -i -H "Host: valid.local:2$" http://127.0.0.1:8080/

Expected behavior:
400 Bad Request (invalid port syntax)

Actual behavior:
200 OK

This demonstrates that the Host header is accepted and used for request processing despite containing invalid characters in the port component.

2. Trailing Whitespace in Host Header

bash
curl -i -H "Host: valid.local%20" http://127.0.0.1:8080/

Expected behavior:
400 Bad Request

Actual behavior:
200 OK

This suggests insufficient normalization or validation of the Host header prior to its use in request handling.

3. Empty Host Header

bash
curl -i -H "Host:" http://127.0.0.1:8080/

Expected behavior:
400 Bad Request (missing mandatory Host header)

Actual behavior:
200 OK

Despite the absence of a valid host value, the request is accepted and processed normally.

4. Multiple Host Headers

bash
curl -i -H "Host: a.com" -H "Host: b.com" http://127.0.0.1:8080/

Expected behavior:
400 Bad Request (ambiguous Host headers)

Actual behavior:
200 OK

Accepting multiple Host headers introduces ambiguity and allows different stages of request processing to potentially observe different values.

Observations

Across all test cases:

  • Requests are not rejected during HTTP parsing
  • No error or warning is logged
  • The application responds normally with 200 OK

This confirms that malformed Host headers are not merely tolerated, but actively influence request routing and processing.

Why This Is a Security Vulnerability

This behavior is not simply an RFC 7230 §5.4 compliance issue.

The core problem is that security checks and request routing do not operate on the same normalized Host value.

In real-world deployments, WildFly is frequently placed behind:

  • Reverse proxies
  • Load balancers
  • Web Application Firewalls (WAFs)

These upstream components typically reject malformed Host headers, returning 403 Forbidden or 400 Bad Request.

When WildFly accepts and processes the same malformed requests, a reliable 403 → 200 bypass emerges:

text
Client → Proxy/WAF → 403
Client → WildFly   → 200

This discrepancy represents a meaningful security boundary violation.

Impact

Depending on deployment and configuration, this issue can enable:

  • Bypass of host-based access controls
  • Virtual host restriction bypass
  • Inconsistent enforcement of security constraints
  • Host header injection in proxy chains
  • Cache poisoning scenarios when combined with intermediaries

The severity does not stem from the malformed header itself, but from the fact that the server accepts and acts on it.

Conceptual Root Cause

The issue appears to arise from inconsistent handling of the Host header across:

  • HTTP parsing and validation
  • Host normalization logic
  • Security constraint evaluation
  • Request routing and virtual host resolution

As a result, the same input may be interpreted differently at different stages of the request lifecycle.

This is a classic example of a security boundary inconsistency, a class of bugs historically associated with high-impact vulnerabilities.

Disclosure Timeline

  • 2025-09-01 – Responsible disclosure to the WildFly Security Team
  • 2025-11-01 – CVE-2025-12543 reserved by Red Hat
  • 2026-01-07 – CVE publicly disclosed by Red Hat

References