Skip to content

Vimeo: ask player.vimeo.com only (code scanning #168) - #357

Merged
Nawid3333 merged 1 commit into
mainfrom
fix/vimeo-request-host
Oct 6, 2026
Merged

Nawid3333 merged 1 commit into
mainfrom
fix/vimeo-request-host

Conversation

@Nawid3333

Copy link
Copy Markdown
Owner

@Nawid3333 The last of the five code scanning alerts. The other four (#164-#167, tools/recut-patch.mjs) are fixed on main in 71b3305: a maintainer tool, no release.

The alert (#168, client-side request forgery). The Vimeo player requested its source's URL, whatever host it named, with the source's headers. The background only hands it player.vimeo.com addresses, but a source's mode can also come from the player's address (faststream-mode=accelerated_vm) or the Sources browser's mode menu, so a crafted player address could point it at any host.

The fix. VMPlayer.vimeoRequestUrl accepts only http(s)://player.vimeo.com/… and rebuilds the address on that fixed host; anything else is refused before any request. Vimeo's own player and config addresses come out byte-identical.

Checked:

  • tests/unit/VMPlayer.test.mjs: real Vimeo addresses kept; other hosts, look-alikes, userinfo @, backslashes, a trailing dot, punycode and a Cyrillic look-alike refused; ports, // and .. stay on player.vimeo.com; no request for a refused host. The refusal test fails without the fix.
  • Lint, tsc, 1960 unit tests green.
  • deepseek's security review of the diff found no way past the check.

Your hand test (1 step). With pnpm run start:ff on this branch, open a Vimeo video (vimeo.com/… or a page with a Vimeo embed): FastStream plays it as before. Then merge (that releases).

🤖 Generated with Claude Code

The Vimeo player requested its source's URL, whatever host it named, with the
source's headers. The background only gives it player.vimeo.com addresses,
but a source's mode can also come from the player's address
(faststream-mode=accelerated_vm) or the Sources browser's mode menu, so it
could be pointed anywhere (CodeQL js/client-side-request-forgery #168, from
the address's #url to RequestUtils' fetch). It now refuses any other host
before a request, and asks on an address rebuilt on player.vimeo.com, which
is byte-identical for Vimeo's own player and config addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Nawid3333 Nawid3333 self-assigned this Oct 6, 2026
@Nawid3333
Nawid3333 merged commit 35714eb into main Oct 6, 2026
25 checks passed
@Nawid3333
Nawid3333 deleted the fix/vimeo-request-host branch October 6, 2026 14:22
Nawid3333 added a commit that referenced this pull request Oct 6, 2026
#168) (#358)

#357 kept the Vimeo player's request on player.vimeo.com but passed the
source's path through, and CodeQL's client-side request forgery rule still
traced the player address's #url to RequestUtils' fetch: a path of the
source's choosing reaches any endpoint on Vimeo's host, with the source's
headers. Only /video/<number> and /video/<number>/config are asked for now,
rebuilt from the number (encodeURIComponent) and the query (after a fixed '?'),
the two things that rule takes as safe. Vimeo's own addresses are unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant