When directConnect(true) is enabled, appium/java-client unconditionally
accepts directConnectHost, directConnectPort, and directConnectPath
from the server's NEW_SESSION response and silently redirects all subsequent
session traffic to the attacker-specified endpoint — with no allowlist,
no host validation, and no user notification.
AppiumCommandExecutor.java (line 196–219): setDirectConnect() builds
a new URL from server-supplied fields and calls overrideServerUrl(newUrl)
without validating host/IP.DirectConnect.java: getUrl() constructs protocol://host:port/path
with no allowlist.Only the protocol is validated (must equal "https"). The destination host and port are never checked against any allowlist or denylist.
A rogue server injecting directConnectHost=127.0.0.1:4443 causes the
client to silently redirect all post-session commands:
[bootstrap] POST /wd/hub/session [bootstrap] Injecting directConnect -> https://127.0.0.1:4443/wd/hub [redirect-target] HIT #1: GET /wd/hub/session/poc-session-001/source [redirect-target] HIT #2: DELETE /wd/hub/session/poc-session-001
Original source code unmodified — confirmed via git diff HEAD (empty).
Screenshot 1 — Rogue server capturing redirected traffic:
<img width="887" height="146" alt="1" src="https://github.com/user-attachments/assets/cc28002c-ea20-4ac8-8336-cec632e3c842" />Screenshot 2 — Java client processing response from attacker host:
<img width="788" height="130" alt="2" src="https://github.com/user-attachments/assets/222cbab0-0d53-45b2-847d-6aa4e3b79370" />Add allowlist...
10.1.1Exploitability
AV:NAC:LPR:NUI:RScope
S:CImpact
C:HI:LA:N8.2/CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:NInput Validation
Other