fix(recorder-core): trim and validate whitespace in openShareUrlInNewTab - #2157
fix(recorder-core): trim and validate whitespace in openShareUrlInNewTab#2157gcoinstash-cmd wants to merge 3 commits into
Conversation
Manage your Superagent protectionSuperagent has paused scans for this repository because this unlinked GitHub App installation has used all three included PR scans. You have 0 of 3 included PR scans remaining. Create a free account to continue protection, manage scan settings, review security history, and control which repositories are protected. |
| TogglePauseRecording, | ||
| TakeScreenshot, | ||
| SetCamera { | ||
| device_id: String, | ||
| }, | ||
| SetMicrophone { | ||
| device_id: String, | ||
| }, |
There was a problem hiding this comment.
Deep links bypass user consent
When a webpage or local application invokes a registered URL such as cap-desktop://take_screenshot, cap-desktop://set_camera?device_id=none, or cap-desktop://pause, the unguarded deep-link path immediately captures the cursor's display or mutates recording and input state, causing screenshots to be written or recording settings to change without the user's intent.
How this was verified: The registered deep-link callbacks were traced through the unguarded parser and executor to screenshot persistence and recording or device-state mutation functions.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 52-59
Comment:
**Deep links bypass user consent**
When a webpage or local application invokes a registered URL such as `cap-desktop://take_screenshot`, `cap-desktop://set_camera?device_id=none`, or `cap-desktop://pause`, the unguarded deep-link path immediately captures the cursor's display or mutates recording and input state, causing screenshots to be written or recording settings to change without the user's intent.
**How this was verified:** The registered deep-link callbacks were traced through the unguarded parser and executor to screenshot persistence and recording or device-state mutation functions.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary of Changes
window.open.packages/recorder-core/__tests__/recorder-utils.test.tsverifying that whitespace strings safely returnfalsewithout triggering browser popup blocks.Test Validation
pnpm test __tests__/recorder-utils.test.ts: 16/16 unit tests passed 100% green.Greptile Summary
The PR trims and validates share URLs before opening them, and also substantially expands the desktop application's production deep-link actions.
Confidence Score: 3/5
The PR is not safe to merge until sensitive production deep-link actions require an explicit authorization or user-confirmation boundary.
Externally invokable custom-scheme URLs now reach screenshot capture and recording or device-state mutations without an intervening trust check, allowing actions with concrete privacy and recording-integrity consequences.
Files Needing Attention: apps/desktop/src-tauri/src/deeplink_actions.rs
Security Review
The new production deep-link actions are reachable through the externally registered
cap-desktopscheme without confirmation. This permits untrusted invocations to capture a screenshot or mutate active recording and device state. How this was verified: The registered deep-link callbacks were traced through the unguarded parser and executor to screenshot persistence and recording/device mutation functions.Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(recorder-core): trim and validate wh..." | Re-trigger Greptile