
PoC and lab for CVE-2026-117517, a Tomcat LoadBalancerDrainingValve open redirect via ;jsessionid and leading slashes, with vuln vs fixed differential harness.
LoadBalancerDrainingValve (incomplete fix of CVE-2026-25854)| CVE | CVE-2026-117517 |
| Component | Apache Tomcat — org.apache.catalina.valves.LoadBalancerDrainingValve |
| Affected | 11.0.19–11.0.27, 10.1.53–10.1.61, 9.0.116–9.0.123 |
| Fixed in | 11.0.29 / 10.1.62 / 9.0.124 — genuine vendor fix |
| CWE | CWE-601 (URL Redirection to Untrusted Site / Open Redirect) |
| Impact | When a node is in the DISABLED (draining) activation state, a crafted request URI is redirected to an attacker-controlled host — phishing / credential theft against users of a load-balanced Tomcat cluster |
| Vector | Network — request URI carrying a ;jsessionid parameter plus leading double slashes |
| Trigger | /;jsessionid=x//evil.example/phish |
The original fix for CVE-2026-25854 added collapseLeadingSlashes(), but
applied it before stripping the ;jsessionid path parameter:
// 11.0.27
String uri = collapseLeadingSlashes(request.getRequestURI()); // one leading slash -> unchanged
if (uri.contains(";" + sessionURIParamName + "=")) {
uri = uri.replaceFirst(";" + sessionURIParamName + "=[^;/]*", ""); // leaves //evil.example/...
}
response.sendRedirect(uri, _redirectStatusCode);
The fix reorders the operations — strip the session parameter first, then collapse leading slashes — so the redirect stays same-host.
/;jsessionid=x//evil.example/phish has a single leading slash, so
collapseLeadingSlashes() leaves it intact. Removing ;jsessionid=x
afterwards exposes the //evil.example/phish protocol-relative URL, which
sendRedirect issues to the client. Reordering the two steps closes the
bypass.
| service | image | role |
|---|---|---|
tomcat-vuln | cve-2026-117517:vuln | tomcat-embed-core 11.0.27 |
tomcat-fixed | cve-2026-117517:fixed | tomcat-embed-core 11.0.29 |
poc | cve-2026-117517-poc:local | stdlib-only Python driver |
A Java 17 harness invokes the real LoadBalancerDrainingValve.invoke() with
the request in DIS draining state and no valid session, using Proxy-based
Context/Valve/Log stand-ins. A Response subclass captures the raw
sendRedirect argument so the protocol-relative redirect is observable
before Tomcat's absolute-URL normalisation.
./run-lab.sh build # Maven artifacts 11.0.27 / 11.0.29 + harness
./run-lab.sh up # cve117517lab network: tomcat-vuln / tomcat-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (stdlib only):
A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=tomcat-vuln
# exit 1 on confirmed open redirect, 0 on a safe target
| URI | tomcat-vuln (11.0.27) | tomcat-fixed (11.0.29) |
|---|---|---|
/;jsessionid=x//evil.example/phish | raw redirect //evil.example/phish | raw redirect /evil.example/phish (same host) |
//evil.example/x | collapsed (single leading slash rule) | collapsed |
/app/page | normal | normal |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt, evidence/versions.txt,
evidence/0day-sweep.txt.
cve117517lab
network.DIS and the requested session is invalid — the harness sets both.The fixed line collapses leading slashes after stripping the session parameter, so the jsessionid bypass yields a same-host relative redirect. Plain double-slash and benign controls behave consistently on both builds. No remaining ordering bypass was found in the valve's URI rewriting.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/pom.xml upstream tomcat-embed-core selector
lab/harness/Harness.java driver invoking the real valve
lab/service.py HTTP wrapper (POST /redirect)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)