Usama Arshad. Résumé

Challenge 14 of 15 Web Full writeup

BlackHat MEA 2026 · Qualifiers

DeckForge.

DeckForge turns attacker-supplied HTML pages into preview images for a slide builder. The renderer runs a real browser with local resources enabled and keeps a nearby helper service for its preview pipeline. Recover the flag from the worker without uploading it.

Web· 4 November 2026

TL;DR

The preview renderer runs Chromium with <code>--allow-file-access-from-files</code> and <code>--disable-web-security</code>, so injected HTML gets an arbitrary local file read <i>and</i> can drive a loopback chromedriver that runs as a different, privileged user.

Captured

01Recon

The front page posts to a single endpoint:

html
POST /html-to-image      {"pages": ["<html>", ...]}   ->    ZIP of page_N.jpg

Your markup is rendered by a real Chromium and handed back as JPEGs. Because local resources are allowed, an iframe pointing at file:// renders the file straight into the screenshot:

snippet
<iframe src="file:///etc/passwd" style="width:900px;height:600px"></iframe>

Two interesting accounts show up, app:1000 and runner:1001, and / contains an unusual bridge/ and runner/. /app/ holds the whole application source.

A file:// -origin page can also read files with a synchronous XMLHttpRequest, which is much nicer than iframes: it lets you slice a file and reformat it so long sources fit in a 1280x720 screenshot. That is how / app/local-run and /app/html_to_image.py were dumped.

02The bug

Three things compose into the bug:

  1. Attacker HTML is rendered with --allow-file-access-from-files, giving an arbitrary local file read from a file:// origin.
  2. --disable-web-security removes the same-origin policy, so that page can issue arbitrary cross- origin requests to loopback and read the responses.
  3. A privileged automation endpoint listens on loopback, a second chromedriver running as runner with --allowed-origins='*'. Its --allowed-ips=127.0.0.1 allowlist is worthless here, because the attacker's code is already executing on 127.0.0.1.

/app/local-run shows why the file read alone is not enough:

snippet
RAND=$(head -c 16 /dev/urandom | od -An -tx1 | tr -d ' \n' | cut -c1-10)
HELPER_PORT=$((38560 + PORT_SEED % 8))
FLAG_VALUE="BHFlagY{deckforge_${RAND}}"          # or $DYN_FLAG

install -d -o runner -g runner -m 0700 /runner printf '%s' "$FLAG_VALUE" > "/runner/flag_${RAND}.txt" chmod 0400 /runner/flag_*.txt

snippet
/usr/sbin/runuser -u runner -- ... /usr/bin/chromedriver --port="$HELPER_PORT" \
  • --allowed-ips=127.0.0.1 --allowed-origins='*' & /usr/sbin/runuser -u app --... /usr/bin/chromedriver --port=40003... &

The flag is 0400 inside a 0700 directory owned by runner, while our rendering browser runs as app, so file:///runner/ renders as an empty directory listing. The file read is real but points at the wrong user. Privilege separation is the intended control, and it is undone by leaving a runner -privileged WebDriver reachable from the sandboxed browser.

--ALLOWED-IPS=127.0.0.1

WHAT THE BRIEF SAID WHAT WAS BEHIND IT

OUR CODE WAS ALREADY ON 127.0.0.1

03Exploitation

WebDriver is just JSON over HTTP, so from the injected page:

  1. POST /session, chromedriver forks a Chrome running as runner
  2. POST /session/{id}/url → file:///runner/, recover the randomised filename
  3. GET /session/{id}/source, the directory listing
  4. navigate to file:///runner/flag_<rand>.txt, GET.../source, the flag

Then print it into the DOM so it is baked into the returned JPEG. Nothing is uploaded anywhere, which is what "without uploading it" asks for.

Two things that must be right

Capabilities, otherwise you brick the instance. Sending default capabilities makes chromedriver launch Chrome without the flags this container needs; Chrome never comes up and takes chromedriver with it (Timed out connecting to Chrome... Segmentation fault). The helper is started once, outside supervisord, so it is not restarted, the pivot is gone for the life of that instance. Mirror html_to_image.py instead; --single-process and --no-zygote are the load-bearing arguments. With these, session creation takes ~2.3 s and succeeds.

The 5-second budget. driver.set_page_load_timeout(5) with no per-page error handling means one slow page fails the entire job. Synchronous XHR blocks the load event, so all blocking work on a page must finish inside 5 s. Session creation alone is ~2.3 s, so the work is split across pages of a single request:

snippet
PAGE           DOES

1              create the session, cache the id in localStorage

2              navigate to file:///runner/ , dump the listing

3              read the flag file, print it + emit a colour strip

4              same as 3 (redundancy)

All pages are written to file:///bridge/deckforge-<id>/page_N.html, so they share one file:// origin and the session id survives. Page 1 also tries GET /sessions first to adopt a session orphaned by an earlier timed-out attempt, so a run that times out still makes progress.

Finding the helper port. It is 38560 + (random % 8), re-rolled per instance, do not hardcode it. The helper logs into the shared /bridge volume, which the file:// primitive can read:

snippet
file:///bridge/chromedriver.log
  -> "ChromeDriver was started successfully on port 38560."

Getting the flag back as text. The only response channel is a JPEG. To avoid an OCR dependency, the flag page also renders the flag as a strip of 24x24 colour blocks, one block per hex nibble from a 16- colour palette chosen for wide separation. Flat 24 px blocks survive JPEG quantisation cleanly, so decode_strip() samples each block's centre pixel and the round trip is exact.

04Dead ends

  • Never touch port 40003. That is the render chromedriver, and it is blocked inside driver.get() on our own page at the moment our JS runs. A request to it deadlocks until the 5 s page-load timeout fires and kills the job. Only the helper port (38560-38567) is safe.
  • Sending default WebDriver capabilities permanently bricks the helper for that instance. This cost two instances before /bridge/chromedriver.log was read and the cause understood.
  • The flag is per-instance (FLAG_VALUE="$DYN_FLAG"), so it must be recovered, not copied. Two verified runs produced two different flags from two different randomised filenames.
  • Fixes for the defender: drop --disable-web-security and --allow-file-access-from-files for untrusted markup, render in a container with no access to the helper's network namespace, and put authentication in front of the helper chromedriver rather than relying on an IP allowlist.