Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-12543-Fix-for-Wildfly — Docker base image with backported Host header validation fix for CVE-2025-12543 in Undertow 1.4.x, enabling secure deployment of WildFly 11 applications. | Kitploit
Tools/GitHubGitHub/kavin71725/cve-2025-12543-fix-for-wildfly
Cloud Infrastructure SecurityContainer SecurityVulnerability AnalysisWeb SecurityDevSecOpsSupply Chain SecurityMisconfiguration
GitHubkavin71725/cve-2025-12543-fix-for-wildfly

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →

CVE-2025-12543-Fix-for-Wildfly

Docker base image with backported Host header validation fix for CVE-2025-12543 in Undertow 1.4.x, enabling secure deployment of WildFly 11 applications.

View Repository
45 months agoNot yet reviewed
Share

WildFly 11.0.0.Final Base Image — CVE-2025-12543 Patch

Overview

This repository provides a Docker base image built on WildFly 11.0.0.Final with a backported fix for CVE-2025-12543, a critical Host header validation vulnerability in Undertow.

The image is intended to be provided to colleagues as a base. They can deploy their own .war application and standalone.xml on top of it.


CVE-2025-12543 Summary

FieldDetail
CVE IDCVE-2025-12543
Componentio.undertow:undertow-core
SeverityCritical (CVSS 9.6)
Affected versionsAll versions < 2.2.39 (including 1.4.x)
Fixed inUndertow 2.2.39 / 2.3.22
WildFly 11 versionundertow-core-1.4.18.Final — affected

Vulnerability Description

Undertow fails to properly validate the Host header in incoming HTTP requests. Requests containing malformed or malicious Host headers are processed without rejection, enabling:

  • Cache poisoning
  • Session hijacking
  • Internal network scanning
  • Cross-tenant data mixing / trust-boundary bypasses

Why Not Upgrade WildFly?

Other users are still on WildFly 11, and there are no current resources or plans to upgrade. The fix was backported directly into the Undertow 1.4.18.Final JAR instead.


Repository Structure

root@kitploit:~
.
├── Dockerfile                                  # Main image definition
├── README.md
├── wildfly-dist-11.0.0.Final.tar.gz           # WildFly 11 distribution archive
├── reports/
│   ├── result-20260401-0230.txt               # CVE scan report that identified the vulnerability
│   └── wildfly_11.0.0.Final_*.txt             # Additional scan reports
└── patch/
    ├── src/
    │   ├── HostHeaderHandler.java             # Backported fix — new handler class
    │   ├── HttpReadListener_only.java         # Decompiled + patched HttpReadListener source (reference)
    │   └── PatchHttpReadListener.java         # Javassist bytecode patcher tool
    ├── build.sh                               # Build script — rebuilds the patched JAR from scratch
    ├── undertow-core-1.4.18.Final.jar         # Original (unpatched) JAR — kept for reference
    └── undertow-core-1.4.18.Final-patched.jar # Patched JAR injected into the image

File Details

Dockerfile

Builds the final image. It:

  1. Uses bitnamilegacy/java:1.8.432-7-debian-12-r2 (OpenJDK 1.8.0_432) as the base
  2. Extracts WildFly 11 into /opt/jboss/wildfly
  3. Replaces the original undertow-core-1.4.18.Final.jar with the patched version
  4. Starts WildFly via standalone.sh -b 0.0.0.0 (binds to all interfaces)

patch/undertow-core-1.4.18.Final-patched.jar

The patched Undertow JAR. It is identical to the original except for two changes:

  • Added: io/undertow/server/handlers/HostHeaderHandler.class (and its inner classes)
  • Modified: io/undertow/server/protocol/http/HttpReadListener.class — injects HostHeaderHandler into the request pipeline

patch/src/HostHeaderHandler.java

The backported Host header validation handler. Ported from Undertow PR #1857 (UNDERTOW-2656).

All constants (IP4_EXACT, IP6_EXACT, character tables) are self-contained — no dependency on APIs added in Undertow 2.x. On every HTTP request, it validates:

  • Host header is present (required for HTTP/1.1)
  • Exactly one Host header (no duplicates)
  • Port is numeric and in range 1–65535
  • IP literals (IPv4, IPv6, IPvFuture) are well-formed
  • Hostname characters are valid RFC 3986 reg-name characters
  • Rejects with 400 Bad Request on any violation

patch/src/PatchHttpReadListener.java

A one-shot Javassist bytecode patcher. It loads HttpReadListener from the original JAR and replaces:

root@kitploit:~
// Before
Connectors.executeRootHandler(connection.getRootHandler(), exchange);

// After
Connectors.executeRootHandler(
    HostHeaderHandler.WRAPPER.wrap(connection.getRootHandler()),
    exchange
);

This injects HostHeaderHandler automatically into every HTTP request, without requiring a full recompile of HttpReadListener (which depends on complex inner classes and xnio internals).

patch/src/HttpReadListener_only.java

Decompiled source of the original HttpReadListener from Undertow 1.4.18.Final, used as a reference to locate the injection point. The patched version of this source is also kept here for audit purposes.

reports/result-20260401-0230.txt

CVE scan report (generated 2026-04-01) that identified CVE-2025-12543 in undertow-core-1.4.18.Final at:

root@kitploit:~
/opt/jboss/wildfly/modules/system/layers/base/io/undertow/core/main/undertow-core-1.4.18.Final.jar

Patch Procedure

1. Identify the vulnerability

The scan report (result-20260401-0230.txt) confirmed undertow-core-1.4.18.Final is affected by CVE-2025-12543 (CVSS 9.6).

2. Research the upstream fix

The fix is in Undertow PR #1857, merged into main (2026-01-09) and backported to 2.2.x and 2.3.x. The fix adds HostHeaderHandler.java and wires it into HttpReadListener to validate the Host header on every request.

3. Assess direct upgrade feasibility

Undertow 1.4.x → 2.2.x is a major version jump with breaking API changes. WildFly 11 is tightly coupled to Undertow 1.4.x via JBoss Modules. A direct JAR swap would cause ClassNotFoundException / NoSuchMethodError at startup.

4. Backport HostHeaderHandler.java

Write a self-contained version of HostHeaderHandler.java compatible with Undertow 1.4.18.Final:

  • Inline all regex constants (IP4_EXACT, IP6_EXACT) — not available in 1.4.x NetworkUtils
  • Remove exchange.isHostIncludedInRequestURI() — not available in 1.4.x HttpServerExchange
  • Keep all validation logic identical to the upstream fix

Compile against the Undertow 1.4.18 + xnio classpath inside the WildFly image:

root@kitploit:~
javac -cp undertow-core-1.4.18.Final.jar:xnio-api-3.5.4.Final.jar:jboss-logging-3.3.1.Final.jar \
      -d out HostHeaderHandler.java

5. Patch HttpReadListener via Javassist

Decompile HttpReadListener with Procyon to locate the injection point:

root@kitploit:~
Connectors.executeRootHandler(this.connection.getRootHandler(), httpServerExchange);

located in handleEventWithNoRunningRequest().

Because HttpReadListener has anonymous inner classes ($1, $2, $3) that cannot be referenced from decompiled source, a full recompile is not feasible. Instead, use Javassist (PatchHttpReadListener.java) to instrument the bytecode directly — replacing the executeRootHandler call to wrap the root handler with HostHeaderHandler.WRAPPER.

root@kitploit:~
java -cp javassist.jar:undertow-core-1.4.18.Final.jar:out \
     PatchHttpReadListener undertow-core-1.4.18.Final.jar out/

6. Repackage the JAR

Copy the original JAR and inject the patched/new class files:

root@kitploit:~
cp undertow-core-1.4.18.Final.jar undertow-core-1.4.18.Final-patched.jar
jar uf undertow-core-1.4.18.Final-patched.jar \
    -C out io/undertow/server/handlers/HostHeaderHandler.class \
    -C out "io/undertow/server/handlers/HostHeaderHandler\$Wrapper.class" \
    -C out "io/undertow/server/handlers/HostHeaderHandler\$1.class" \
    -C out io/undertow/server/protocol/http/HttpReadListener.class

7. Update the Dockerfile

Add a COPY for the patched JAR and replace the original inside the image:

root@kitploit:~
COPY patch/undertow-core-1.4.18.Final-patched.jar /tmp/
RUN cp /tmp/undertow-core-1.4.18.Final-patched.jar \
       /opt/jboss/wildfly/modules/system/layers/base/io/undertow/core/main/undertow-core-1.4.18.Final.jar

8. Build and validate

root@kitploit:~
docker build -t wildfly:11.0.0.Final-patched .

Validation:

root@kitploit:~
# Valid Host header — should return 200
curl -v -H "Host: localhost:8080" http://localhost:8080/

# Bad characters in Host — should return 400 Host Header Bad Characters
curl -v -H "Host: evil<script>" http://localhost:8080/

# Duplicate Host headers — should return 400 Bad Request
# Note: curl deduplicates Host headers internally, so a raw TCP request is required for this test
exec 3<>/dev/tcp/localhost/8080; \
printf "GET / HTTP/1.1\r\nHost: localhost\r\nHost: evil.com\r\nConnection: close\r\n\r\n" >&3; \
sleep 1; head -1 <&3; exec 3>&-

# Port out of range — should return 400 Host Header Malformed Port
curl -v -H "Host: localhost:99999" http://localhost:8080/
RequestExpectedResult
Host: localhost:8080 (valid)200 OK✓
Host: evil<script> (bad chars)400 Host Header Bad Characters✓
Two Host: headers (duplicate, raw TCP)400 Bad Request✓
Host: localhost:99999 (bad port)400 Host Header Malformed Port✓

Known Behavioral Change

HTTP/1.1 Requests Must Include a Host Header

Before this patch, WildFly's REQUIRE_HOST_HTTP11 option defaulted to false, meaning HTTP/1.1 requests without a Host header were silently accepted.

After this patch, the HostHeaderHandler enforces RFC 7230 strictly — all HTTP/1.1 requests without a Host header are rejected with 400 No Host Header, regardless of the REQUIRE_HOST_HTTP11 setting.

Who may be affected:

  • Health check probes sending bare GET / HTTP/1.1 without a Host header
  • Internal monitoring agents or load balancer pings that omit the Host header
  • Any custom HTTP/1.1 client that does not set a Host header

What to do: Ensure all HTTP/1.1 clients include a Host header. This is already required by RFC 7230 and any standard HTTP library (curl, Java's HttpClient, etc.) does this automatically. Only non-compliant or very old custom clients are affected.

root@kitploit:~
# This will now be rejected with 400:
GET /health HTTP/1.1
Connection: close

# This is correct and will work fine:
GET /health HTTP/1.1
Host: your-server:8080
Connection: close

Rebuilding the Patched JAR from Scratch

If you need to regenerate patch/undertow-core-1.4.18.Final-patched.jar in a new environment (e.g., the pre-built JAR is unavailable), use the provided build script.

Requirements: Java 8 JDK, curl, internet access to Maven Central.

root@kitploit:~
cd patch
bash build.sh

The script will:

  1. Download all required JARs from Maven Central (undertow-core, xnio-api, jboss-logging, javassist)
  2. Compile HostHeaderHandler.java
  3. Compile and run PatchHttpReadListener.java to patch HttpReadListener bytecode via Javassist
  4. Repackage everything into undertow-core-1.4.18.Final-patched.jar

After it completes, proceed with docker build as normal.


Building the Image

Note: wildfly-dist-11.0.0.Final.tar.gz is not included in this repository (exceeds GitHub's 100 MB limit). Download it from Maven Central before building:

root@kitploit:~
https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/11.0.0.Final/wildfly-dist-11.0.0.Final.tar.gz
root@kitploit:~
docker build -t wildfly:11.0.0.Final-patched .

Running the Image

root@kitploit:~
docker run -d -p 8080:8080 wildfly:11.0.0.Final-patched

Colleagues can mount or extend the image with their own deployment:

root@kitploit:~
FROM wildfly:11.0.0.Final-patched
COPY standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml
COPY myapp.war /opt/jboss/wildfly/standalone/deployments/
Download Tool