fix(audit): enterprise hardening — sandbox, browser, session atomicity#11
Open
ForkedInTime wants to merge 1 commit intomainfrom
Open
fix(audit): enterprise hardening — sandbox, browser, session atomicity#11ForkedInTime wants to merge 1 commit intomainfrom
ForkedInTime wants to merge 1 commit intomainfrom
Conversation
…omicity Security: - sandbox: shell-quote cwd in bwrap/firejail wrappers so paths with spaces or shell metacharacters can't break out of the sandbox - browser/actions: validate_navigation_url rejects javascript:/data:/file:/ ftp: and other non-http(s)/about schemes (+ 3 unit tests) - rag/indexer: skip symlinked files so a crafted repo can't redirect indexing into ~/.ssh, /etc, etc. - main: respect NO_COLOR and TERM=dumb to disable ANSI in pipes/CI Data integrity: - session: atomic_write helper (sibling tempfile → sync_all → rename) replaces fs::write in SessionMeta::save() and Session::overwrite(); crashes mid-write can no longer leave truncated .meta or .jsonl files (+ 3 unit tests) Browser feature wiring: - browser/mod: BrowserSession gains console_buf (cap 500) + console_task; spawned listener captures Runtime.consoleAPICalled + Runtime.exceptionThrown; aborted + drained on close - new browser_console tool drains and returns captured messages (+ 8 unit tests covering formatters, drain, overflow) API honesty: - tools/agent: remove unimplemented run_in_background field from the Agent tool's input schema and AgentInput struct (was advertising a feature the runtime ignored) - autofix: replace stale "reserved for future" doc on max_retries — the multi-turn retry loop is fully wired in tui/run.rs UX polish: - commands: upgrade /login, /logout, /fast migration-helper messages to point at real, verified commands (/model <provider>:<name>, /model haiku, /router) - tui/diff: strip aspirational "hunk-walker UI" comment; replace with a factual note that hunks/lines exist for the test suite Dead code removed (~105 LOC): - browser/extraction.rs (full module, fully #[allow(dead_code)]) - browser/actions::handle_dialog (unused) - browser/cdp::is_alive (unused) Build clean, 29 test groups green, 14 new unit tests added across the audit (URL validation 3, console listener 8, atomic_write 3). Co-Authored-By: Arch Linux <noreply@archlinux.org>
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.
Summary
Four-pass enterprise audit before the millions-of-users launch. 14 fixes across security, data integrity, UX honesty, and dead-code removal. Build clean, 29 test groups green, 14 new unit tests.
Security
cwdinbwrap_wrap/firejail_wrap— paths with spaces or shell metacharacters no longer break the sandboxvalidate_navigation_urlrejectsjavascript:,data:,file:,ftp:, … (only http/https/about allowed)~/.ssh,/etcNO_COLORandTERM=dumbto disable ANSI in pipes/CIData integrity
atomic_write(sibling tempfile →sync_all→ atomic rename) replacesfs::writeinSessionMeta::save()andSession::overwrite(); crashes mid-write can no longer leave truncated.metaor.jsonlfilesBrowser feature wiring
BrowserSession:console_buf(cap 500) + spawned listener forRuntime.consoleAPICalledandRuntime.exceptionThrown; aborted + drained on closebrowser_consoletool: drains and returns captured messagesAPI honesty
run_in_backgroundfield from input schema (was advertising a feature the runtime ignored)max_retries— the multi-turn retry loop is fully wiredUX polish
/login,/logout,/fastmigration-helper messages to point at real, verified commands (/model <provider>:<name>,/model haiku,/router)Dead code removed (~105 LOC)
browser/extraction.rs(full module, fully#[allow(dead_code)])browser/actions::handle_dialogbrowser/cdp::is_aliveTest plan
cargo build --release— cleancargo test --release— 29 test groups, 0 failurescargo clippy --release --all-targets— only pre-existing style nits/browser_console,/login,/fast, sandbox with spaces in cwd