Skip to content

fix(engine,producer): render-network setting reads like a switch; render-service probes stay on checked inputs - #7807

Merged
michaelwang11394 merged 6 commits into
mainfrom
sec-render6-1115
Nov 15, 2026
Merged

michaelwang11394 merged 6 commits into
mainfrom
sec-render6-1115

Conversation

@michaelwang11394

Copy link
Copy Markdown
Contributor

What

Three render-service hardening fixes. Local renders, which don't set the render-network setting, are unchanged.

  • The setting reads like a switch. PRODUCER_RESTRICT_PAGE_NETWORK accepts true, 1, yes and on to turn on, and false, 0, no and off to turn off, in any case and with spaces around them. Unset or blank stays off. Any other value restricts and warns once per distinct value, instead of failing open.
  • The audio-only probe reads remote videos through the downloader. With the setting on, a remote video src is downloaded through the shared downloader (pinned DNS, every redirect checked) into the mixer's work folder, and probed from that copy. The mix reuses it. A URL the address rules refuse is skipped, with one warning. Not-found errors, timeouts and cancels fail as before. Videos that are silent, muted or hidden aren't downloaded.
  • ffmpeg's in-place https reads get the format allowlist. With the setting on, every https input ffmpeg or ffprobe reads in place gets the same -format_whitelist of self-contained formats as fix(cli,studio-server): received-file guard covers subfolders and spellings; playlists named as media never reach ffmpeg #7771. A playlist named .mp4 then fails to open instead of steering ffmpeg to other inputs.

Why

These are three paths where a composition could make the render host reach addresses, or open inputs, that the render-network setting is meant to keep out:

  • a misspelled setting value;
  • ffprobe doing its own DNS and following redirects;
  • ffmpeg following a playlist hidden behind a media extension.

Related work

Refs #7758, #7764, #7771, #7780.

How

  • engine/config.ts: resolveRestrictPageNetwork parses the value. Docs are updated.
  • producer/services/render/stages/extractVideosStage.ts: the probe uses downloadToTemp when the setting is on, gets the cancel signal and the mixer's work folder, and skips silent, muted and hidden videos.
  • engine/utils/urlInput.ts: adds -format_whitelist for https inputs when the setting is on.

Test plan

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

  • engine vitest (config, urlInput, browserManager, ffprobe.remoteIdentity): 267 pass, 3 skipped. producer bun: videoAudioProbe 10/10, plan audio 12/12. downloader: 91/91.

  • The new tests fail on main.

  • Manual: -format_whitelist is accepted by ffprobe 4.0.2 (the same package version Lambda uses), ffprobe 4.4, ffmpeg 6.0 and ffmpeg 8. These all still open: mp4, mov, m4a, webm, mkv, ts, avi, mp3, aac, wav, ogg/opus, flac, aiff, png, jpg, gif, bmp and tiff. An HLS list named .mp4 is refused.

  • Not run: a real Lambda or cloud render. The Lambda loader still picks remote files by extension; binding that to checked content is a larger change.

…d restrict on an unknown value

true, 1, yes and on turn the render network restriction on and false, 0,
no and off leave it off, in any letter case and with surrounding
whitespace. Unset or blank stays off for local renders. Any other value
now restricts and logs a warning once, instead of leaving the render
browser and ffmpeg URL inputs unrestricted.
…n URL from a downloaded copy

With PRODUCER_RESTRICT_PAGE_NETWORK on, a video URL the composition
names is fetched through the shared downloader (resolved-address check,
pinned connection, per-hop redirect checks) before ffprobe reads it, and
skipped if the download is refused. In a distributed audio step the copy
lands in the mixer's work folder, so the mix reuses it instead of
downloading again. Without the flag the probe reads the URL as before.
…t be a self-contained container

With PRODUCER_RESTRICT_PAGE_NETWORK on, every https input ffmpeg or
ffprobe opens directly (such as a signed storage URL for a project's
video or audio sidecar) also gets -format_whitelist with the same
self-contained containers the Studio media helpers allow. A playlist,
manifest or concat list stored under a media file name can no longer
make ffmpeg open other network locations. Local renders are unchanged.
… and downloads once

A composition URL is skipped, with one warning, only when the download
address rules refuse it. Timeouts, HTTP errors and a cancelled render
fail the probe as before. Videos without sound, muted or hidden are not
downloaded. The in-process extract stage passes the render's abort
signal and the mixer's work folder, so the mix reuses the copy.
@mintlify

mintlify Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 15, 2026, 6:00 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 113 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (3)

  • seqresize-none-pct-r0-nested-z100: tracking 0.04, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.04, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.04, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true
  • seqfastkeys-none-px-r0-root-z100: tracking 0.07, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.07, pressJump 0.05, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true
  • seqab-none-pct-r0-root-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 60fb369

The network switch preserves the existing unset/blank default, accepts the documented case/whitespace variants, and restricts unknown values. The audio-only probe uses the checked downloader and the mixer's work directory; only address-policy refusals are skipped, while other download failures and cancellation propagate. Existing HTTPS ffmpeg/ffprobe input paths share the new format restriction.

Nit — share the supported demuxer list (packages/engine/src/utils/urlInput.ts:15–16, packages/studio-server/src/helpers/mediaExtensions.ts:35–39). The new list duplicates the existing media-input list byte for byte. Move the list to a lower-level shared module in a follow-up so support changes cannot drift between the renderer and Studio/CLI helpers.

Validation through the shared gate: frozen install/full bun run build passed. Engine config, urlInput, browserManager, ffprobe.remoteIdentity and urlDownloader suites: 361 passed. Producer videoAudioProbe and planAudioCompat: 15 committed tests passed, plus 1 temporary real-ffprobe control passed showing a downloaded list does not reach a second HTTP endpoint on this host. Reverting the config and URL-input changes makes 10 tests fail, 127 pass. Restored all temporary changes. The producer tests cover permitted media with a downloader stand-in and real local probing, refusal, cancellation and work-folder placement; no actual public-network render or Lambda/cloud deployment was exercised.

Commands: bun run --cwd packages/engine test src/config.test.ts src/utils/urlInput.test.ts src/services/browserManager.test.ts src/utils/ffprobe.remoteIdentity.test.ts src/utils/urlDownloader.test.ts --maxWorkers=1; producer: bun test src/services/render/stages/videoAudioProbe.test.ts src/services/distributed/planAudioCompat.test.ts.

Need: yes · Size: ok, three related host-policy fixes · Reuse: checked downloader, audio-work cache and shared URL-input arguments · Simpler: already bounded · Structure: extract the duplicate demuxer list into the existing lower-level media contract
Risk: medium — changes render-host network configuration and remote media probing.

Verdict: APPROVE
Reasoning: The change preserves the default and permitted-media path while closing the intended policy gaps; the duplicate list is a nonblocking maintenance follow-up.

— Rames

…ne size budget

audioWorkDir moves to render/shared.ts, so tests that replace the audio
stage module still load the orchestrator. The format-whitelist test
probe ends its options with -- as the ffprobe argv contract requires.
The engine packed size budget rises to 500000 bytes.
@michaelwang11394

Copy link
Copy Markdown
Contributor Author

CI fixes in d5abeb4, on top of a merge of main:

The full producer vitest lane passes 91/91. One plan audio test times out intermittently on main too.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at d5abeb4

Re-reviewed the delta from 60fb369. The four original commits are preserved, and the main merge has no manual conflict-resolution delta. The new production change moves unchanged audioWorkDir() into render/shared.ts; all three callers use that location, with no new runtime import cycle. The other changes repair the ffprobe test invocation and raise the engine packed-size budget. The prior demuxer-list reuse nit remains nonblocking.

Validation through the shared gate: frozen install/full bun run build passed; engine config/URL-input tests 137 passed, producer probe/plan-audio tests 15 passed. pnpm pack --json measures the engine at 495,980 packed / 1,662,133 unpacked bytes, within the declared 500,000 / 1,742,862 budgets. No real public-network/cloud render or dev walkthrough performed.

Commands: bun run --cwd packages/engine test src/config.test.ts src/utils/urlInput.test.ts --maxWorkers=1; producer bun test src/services/render/stages/videoAudioProbe.test.ts src/services/distributed/planAudioCompat.test.ts; engine pnpm pack --json --pack-destination <temporary-directory>.

Need: yes · Size: focused integration follow-up · Reuse: shared render helper module · Simpler: unchanged helper, one owner · Structure: fine (checked all three imports and the shared module's type-only orchestrator dependency; no split)
Risk: medium — underlying change restricts render-host networking; this delta preserves that policy.

Verdict: APPROVE
Reasoning: The helper relocation integrates cleanly, the tests load the real producer successfully, and the measured package fits its budget.

— Rames

@michaelwang11394
michaelwang11394 added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit be740d0 Nov 15, 2026
92 of 93 checks passed
@michaelwang11394
michaelwang11394 deleted the sec-render6-1115 branch November 15, 2026 07:49
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.

2 participants