Repository navigation
Conversation
…ck host The rendering server bound to 127.0.0.1 but served any Host header, so a web page that rebinds its own name to 127.0.0.1 could read staged program HTML, media and decoded frames while a render ran. Reply 421 unless the request addresses the server by the URL it handed to Chrome.
…Host A name that resolves to loopback but is not the server's own host, with or without the port, must still get 421.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #479
Problem
serveHtmlProgrambinds127.0.0.1on an ephemeral port and serves the staged render directory (program HTML, project media, decoded source frames). It never checks theHostheader. A web page whose own hostname is rebound to127.0.0.1(DNS rebinding) is then same-origin with the server and can read every staged file while a render is running.Impact
Low. The attacker has to find the ephemeral port and complete a rebind within the render's lifetime. What leaks is the user's render material, not arbitrary files, because path containment is already enforced.
Reproduction (on origin/main)
Start
serveHtmlProgram(dir)and request/withHost: attacker.example:<port>. The response is200withindex.html.Fix
Reply
421 Misdirected RequestunlessHostis exactly127.0.0.1:<port>, the address the server hands to Chrome. The capture page and its source-frame URLs always use that URL, so rendering is unaffected.Tests
packages/provider-html-local/test/server.test.tschecks that the server's own host gets 200 and thatattacker.example:<port>andlocalhostget 421. It fails on origin/main (200) and passes with the fix.HYPIT_BROWSER_TESTS=1,frames.test.tsandvisual-readiness.test.ts, Chromium): 17/17 pass.pnpm install --frozen-lockfile,pnpm check: pass.pnpm test: 1148 tests, 1125 pass, 0 fail (23 skipped by environment gates).Note: #421 touches the same file (range handling). The two changes are independent and should merge cleanly or with a trivial conflict.