security: fix sandbox bypass, env race, and unsafe SAFETY docs#1231
Closed
BunnyMoth wants to merge 14 commits into
Closed
security: fix sandbox bypass, env race, and unsafe SAFETY docs#1231BunnyMoth wants to merge 14 commits into
BunnyMoth wants to merge 14 commits into
Conversation
- tool_media_describe/transcribe now route through workspace sandbox - API keys moved from process env to RwLock<HashMap> in AppState - Add SAFETY comment to libc::kill in kernel.rs
…, PII logs, QR cleanup
Author
|
Hi — I'm aware this PR is broader than the one-concern guideline in
Happy to split into separate PRs if that makes review easier. Also Let me know how you'd like to proceed. |
Author
|
Closing this in favour of focused PRs as per CONTRIBUTING.md guidelines:
WASM sandbox fixes (Gap A/B/C/D) will follow once the above are reviewed. |
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.
##Security fixes — sandbox bypass, env race condition, unsafe docs
Note: commit 2cc8041 (lettre CVE fix) overlaps with #1208 which was
already open. Happy to rebase and drop that commit if preferred —
the remaining 6 commits are independent fixes.
Changes
HIGH: Workspace sandbox bypass in media tools
tool_media_describe and tool_media_transcribe bypassed the workspace
sandbox entirely, allowing agents to read arbitrary host files. Both
now use resolve_file_path the same way all other file tools do.
HIGH: std::env::set_var/remove_var in async Axum handlers
Process environment was being used as a live config store from
multi-threaded request handlers — undefined behaviour under concurrent
requests and a compile error on Rust 1.81+. Replaced with
RwLock<HashMap<String, String>> in AppState, pre-populated from
resolve_credential at startup.
LOW: Missing SAFETY comment on libc::kill
Documented the three invariants: PID origin, Mutex guard, and
ESRCH no-op case.
Fix: rustfmt and missing api_keys in test AppState initializers
cargo fmt and test file updates to match the new AppState field.
Fix: TOCTOU and staging collision in clawhub.rs
sequence that never leaves the slot empty
Perf: reuse reqwest::Client across WASM host calls
Moved client into GuestState — created once, shared across all
host calls via connection pool.
Security: harden WhatsApp gateway
Chore: package-lock.json for WhatsApp gateway
Pins dependency tree, npm audit confirms 0 vulnerabilities.
Fix: lettre CVE (RUSTSEC-2026-0141)
Bumped lettre 0.11.21 → 0.11.22. Fixes TLS hostname verification
bypass (severity 9.1). cargo audit now reports 0 vulnerabilities.