fix(security): sanitize and validate URL recipe injection #1352 - #1759
fix(security): sanitize and validate URL recipe injection #1352#1759Tarulatapriya wants to merge 1 commit into
Conversation
👋 Thanks for your PR, @Tarulatapriya!Welcome to Reframe — a browser-based video editor built for everyone 🎬
What happens next
Quick checklist
Useful links
Happy coding! 🎉 |
✅ PR Format Check Passed — @TarulatapriyaBasic format checks passed. A maintainer will review your code changes. This does not mean the PR is approved — it just means the format is correct. |
|
I've submitted this PR to fix the URL recipe injection vulnerabilities (Issue #1352) under GSSoC '26. Here’s a quick summary of what I did: Validation: Updated isValidRecipe to tightly type-check and range-check the inner fields of the textOverlays array. |
Description
This PR addresses issue #1352 by enforcing strict validation and sanitization for Editor Recipes, preventing maliciously crafted URLs from crashing the app or the FFmpeg worker thread.
Fixes Made:
src/lib/types.ts: UpdatedisValidRecipeto strictly type-check and range-check the inner fields of thetextOverlaysarray.src/lib/editorPersistence.ts: EnhancedmigrateRecipewith robust clamping for core recipe properties (quality, speed, brightness, resolution, etc.). IntroducedsanitizeTextOverlayto clamp font sizes to a safe range (12-120), clamp x/y positions to0-100, and strictly validate hexadecimal colors.src/hooks/useVideoEditor.ts:updateRecipe: Now validates all values inside patches usingisValidValuebefore applying them to state.decodeRecipefails to decode an invalid URLsettingsparameter, the app now actively removes the bad parameter usinghistory.replaceStateso that page reloads don't retry applying broken settings.Related Issues
Fixes #1352
Type of Change
Additional Notes