[PR #8338] [MERGED] fix(video): secure OpenRouter polling and content URLs #8304

Closed
opened 2026-10-27 06:07:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8338
Author: @SpicyMarinara
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/openrouter-relative-video-polling


📝 Commits (3)

  • 14a6d83 chore: start OpenRouter polling URL repair
  • 3e8f054 fix(video): resolve OpenRouter polling URLs against trusted origin
  • 697e2b0 fix(video): keep OpenRouter credentials off unsigned CDN downloads

📊 Changes

2 files changed (+144 additions, -5 deletions)

View changed files

📝 packages/server/src/services/video/video-generation.ts (+24 -5)
➕ scripts/regressions/openrouter-video-polling.regression.ts (+120 -0)

📄 Description

Linked issue

Closes #8337. Related investigation: Pasta-Devs/Marinara-Agents#1706.

Why this change

OpenRouter documents relative polling URLs and can return video files on a public CDN. Engine rejected relative polls after submitting a job and unconditionally forwarded the saved API key to initial content URLs, including another origin.

What changed

  • Scope authorization to the configured API origin. Public CDN content downloads receive no API key, while the authenticated fallback content route continues working.
  • Resolve relative polling and content URLs against the trusted submission endpoint. Reject foreign polling origins and embedded credentials, retaining existing HTTPS, public-address, response-size and MP4 checks.
  • Cover 21 synthetic cases: relative/absolute/fallback paths, a configured proxy, initial CDN header assertions, and malformed, credential-bearing or unsafe-protocol URLs. URL failures never resubmit the paid job.

Validation

Final pnpm check passed. The 21-case async URL/header regression and existing OpenRouter model regression passed. Local committed CodeRabbit reviews completed with zero findings for the original repair and content-security follow-up.

The direct-CDN regression first reproduced Bearer forwarding. A fresh disposable package-manager proof then installed Gacha Forge, restarted Engine and used its verified package/runtime, gallery adapter, queue and OpenRouter serializer: relative polling completed, CDN downloads had no authorization, cache reuse submitted zero jobs and explicit retry submitted one. All provider HTTP responses and credentials were synthetic.

This post-submission defect does not establish the separate report that no remote generation activity appears. No real paid-provider or physical-device validation is claimed.

  • Manually verify OpenRouter video generation on the affected installation.
  • Manually verify a configured API proxy, if used.
  • Read and followed CONTRIBUTING.md.

Docs and release impact

No public capability, dependency, version, permission or storage-format changes. This repairs the existing provider URL and credential boundary; no user documentation changes are required.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8338 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/openrouter-relative-video-polling` --- ### 📝 Commits (3) - [`14a6d83`](https://github.com/Pasta-Devs/Marinara-Engine/commit/14a6d836391d4460f82c2c770b28d37c1b6a391b) chore: start OpenRouter polling URL repair - [`3e8f054`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e8f054cdb61a0f8207037c6905531da395a1ec2) fix(video): resolve OpenRouter polling URLs against trusted origin - [`697e2b0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/697e2b0b7eab7b073a95b33dadf1c9f70d8b90f1) fix(video): keep OpenRouter credentials off unsigned CDN downloads ### 📊 Changes **2 files changed** (+144 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/video/video-generation.ts` (+24 -5) ➕ `scripts/regressions/openrouter-video-polling.regression.ts` (+120 -0) </details> ### 📄 Description ## Linked issue Closes #8337. Related investigation: Pasta-Devs/Marinara-Agents#1706. ## Why this change OpenRouter documents relative polling URLs and can return video files on a public CDN. Engine rejected relative polls after submitting a job and unconditionally forwarded the saved API key to initial content URLs, including another origin. ## What changed - Scope authorization to the configured API origin. Public CDN content downloads receive no API key, while the authenticated fallback content route continues working. - Resolve relative polling and content URLs against the trusted submission endpoint. Reject foreign polling origins and embedded credentials, retaining existing HTTPS, public-address, response-size and MP4 checks. - Cover 21 synthetic cases: relative/absolute/fallback paths, a configured proxy, initial CDN header assertions, and malformed, credential-bearing or unsafe-protocol URLs. URL failures never resubmit the paid job. ## Validation Final `pnpm check` passed. The 21-case async URL/header regression and existing OpenRouter model regression passed. Local committed CodeRabbit reviews completed with zero findings for the original repair and content-security follow-up. The direct-CDN regression first reproduced Bearer forwarding. A fresh disposable package-manager proof then installed Gacha Forge, restarted Engine and used its verified package/runtime, gallery adapter, queue and OpenRouter serializer: relative polling completed, CDN downloads had no authorization, cache reuse submitted zero jobs and explicit retry submitted one. All provider HTTP responses and credentials were synthetic. This post-submission defect does not establish the separate report that no remote generation activity appears. No real paid-provider or physical-device validation is claimed. - [ ] Manually verify OpenRouter video generation on the affected installation. - [ ] Manually verify a configured API proxy, if used. - [ ] Read and followed `CONTRIBUTING.md`. ## Docs and release impact No public capability, dependency, version, permission or storage-format changes. This repairs the existing provider URL and credential boundary; no user documentation changes are required. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-27 06:07:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8304
No description provided.