Fix --browser path traversal; make --timeout govern per-action timeouts - #120
Open
ao-kamal wants to merge 2 commits into
Open
Fix --browser path traversal; make --timeout govern per-action timeouts#120ao-kamal wants to merge 2 commits into
ao-kamal wants to merge 2 commits into
Conversation
A --browser name becomes a directory segment in the on-disk profile path (<baseDir>/<name>/chromium-profile), but was never validated — so `--browser ../../../x` escaped baseDir. Add assertSafeBrowserName (mirroring temp-files.ts's containment guard) and call it at ensureBrowser, connectBrowser, and launchBrowser before the name reaches path.join. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> (cherry picked from commit ce0d5c8)
…P0-1) The script-level --timeout budget bounded only the QuickJS script clock; every Playwright action (goto/click/screenshot/snapshotForAI) kept its own fixed 30s default, so `--timeout 90` still died at 30s mid-action — the costliest timeout confusion in the field (32 incidents). Add BrowserManager.setDefaultTimeouts and call it from the daemon's runScript with the script's remaining budget, so per-action timeouts inherit --timeout. The script clock stays the real ceiling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> (cherry picked from commit d73652c)
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.
Two daemon fixes surfaced by a systematic agent-ergonomics review.
Security —
--browserpath traversal. A--browsername becomes a directory segment in the on-disk profile path (<baseDir>/<name>/chromium-profile) but was never validated, so--browser ../../../xescapedbaseDir. AddsassertSafeBrowserName(mirroring the containment guard already intemp-files.ts), enforced atensureBrowser/connectBrowser/launchBrowser.--timeoutdidn't reach per-action timeouts.--timeoutbounded only the QuickJS script clock; every Playwright action (goto/click/screenshot) kept its own fixed 30s default, so--timeout 90still died at 30s mid-action. Propagates the script budget tocontext.setDefaultTimeout/setDefaultNavigationTimeout.Both covered by new vitest tests; full daemon suite green.