fix(ipc): confine browser recordings to the recordings directory#738
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChangesRecorded video path handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
meiiie
marked this pull request as ready for review
July 10, 2026 19:55
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.
Description
Confines
store-recorded-videowrites to app-generated recording names under the configuredrecordings directory. The IPC handler now treats
fileNameas untrusted runtime input, validates itbefore the target write, and resolves the accepted path as a strict descendant of the recordings
root.
The accepted forms match the current primary and webcam recorder callers:
recording-<timestamp>.webm|mp4recording-<timestamp>-webcam.webm|mp4Motivation
The handler previously passed a renderer-supplied filename directly to
path.joinand thenfs.writeFile. Traversal components could therefore select a target outside the configuredrecordings directory, while nested and platform-specific path forms had no explicit contract.
Main-process IPC boundaries must validate the renderer data they use for filesystem writes.
Type of Change
Related Issue(s)
Architecture remediation trust-boundary finding. PR #737 establishes the standard typecheck/lint/test
workflow and contains the one unrelated
maintypecheck baseline fix.Testing Guide
npx vitest --run electron/ipc/recording/storagePath.test.ts electron/ipc/project/manager.test.ts npx biome lint electron/ipc/recording/storagePath.ts electron/ipc/recording/storagePath.test.ts electron/ipc/register/recording.ts npm testResults:
timeout;
--noUnusedLocals false; standard typecheck reaches only the unrelatedunused import on current
main, already removed by ci: add pull-request quality checks #737.Risk and non-goals
The change preserves the existing result/error contract and both live caller filename forms. It is
limited to renderer-controlled filename traversal. It does not redesign preload capabilities, change
valid-name overwrite behavior, or claim protection against a hostile same-user process that can
pre-place filesystem symlinks.
Checklist
Summary by CodeRabbit
Bug Fixes
Tests