browser-use-terminal
Audited by Socket on Sep 17, 2026
10 alerts found:
Anomalyx7Securityx3No clear evidence of intentional malware/sabotage is visible in this runtime code fragment (no unsafe memory operations, no obvious backdoor networking). However, it contains a high-risk design feature: provider auth can be fetched by spawning an external command (ProviderCommandAuthConfig.command/args/cwd) and using its stdout as an access token. If an attacker can influence that configuration or the auth-file path inputs, this can enable arbitrary process execution and credential/token exfiltration. Additionally, it reads/writes OAuth/token snapshots from paths derived from environment variables, which could be abused if path control exists. Security risk is therefore primarily about misuse/attack-surface rather than confirmed malicious behavior.
High-risk capability code: this worker executes untrusted request['code'] via exec(...), controls a real Chromium instance via remote debugging/CDP (including cookie setting and new-document script injection), and can copy/write arbitrary local files into artifacts while emitting protocol events to stdout. This combination makes it suitable for legitimate automation, but also represents a strong supply-chain/sabotage risk if an attacker can influence the request payload or environment/helper inputs. No obvious hardcoded credentials or explicit remote exfil to a specific attacker domain is visible in this fragment, but the primitives are sufficient for misuse.
No explicit malware/backdoor/credential-theft code is evident in this fragment. However, it implements a high-privilege capability: CDP `Runtime.evaluate` executes attacker-influenced JavaScript in the browser context, and the included embedded helper can perform credentialed `fetch()` to caller-specified URLs and return response contents (including base64 binary) back to Python. This should be treated as security-critical and requires strict upstream trust boundaries (allowlisting/validation for `expression` and network request targets). The unusually large interleaved documentation-like block within the generated JS template is an additional correctness/anomaly signal that warrants verification in the actual packaged source.
No direct indicators of stealthy malware (no network/exec/obfuscation in this module), but the tool is a powerful arbitrary filesystem modification primitive driven by untrusted patch input. The critical issue is permissive path resolution (absolute paths honored and root/workspace boundary not enforced), combined with sandbox escalation on failure. If an attacker can control the patch envelope (and/or the root/cwd selection), they can potentially read, write, move, and delete files outside the intended workspace, enabling supply-chain sabotage. Treat this component as high risk unless strongly access-controlled and path-confined by surrounding orchestration.
No direct malicious or obfuscated behavior is evident in this Rust adapter itself; it is a deliberately thin conduit that executes arbitrary Python code via an external persistent worker and returns execution results, tracebacks, and artifact/image metadata to the model. The main security exposure is inherent high-impact arbitrary code execution plus pass-through of cwd/artifact_dir with minimal validation at this layer. Real security depends on browser-use-python-worker’s sandbox/containment and the host’s policy enforcement (since this layer provides no approval gate and delegates sandbox decisions).
This Rust module is an intentional analytics/telemetry client that sends caller-provided product event data to PostHog over HTTPS and persists a stable `install_id` as `distinct_id` in the application state directory. It contains no evident malicious execution patterns (no unsafe/FFI, no command execution, no obfuscation), but it does present notable privacy and supply-chain risks: hard-coded PostHog API keys, persistent cross-session tracking via disk, and direct inclusion of arbitrary caller-provided `properties` in the outbound request (with telemetry host partially configurable via environment variables).
No explicit evidence of intentional malware in this module (no hardcoded secrets, persistence, or covert network behavior). However, this code is security-critical because it executes shell commands (`/bin/sh -c`) based on configuration-derived `hook.command_line()`. If attackers can influence hook configuration/commands or hook executables, this is effectively an RCE/supply-chain execution risk. Additionally, the authorization/blocking logic can be triggered by untrusted hook output conventions: when stdout isn’t valid JSON and exit code is 2, the runtime blocks and uses untrusted stderr content as the block reason. PermissionRequest emission forwards `tool_input` and optional `reason` into an external sink, which could cause data exposure depending on the sink’s downstream handling. Overall risk is dominated by the shell command execution and trust boundary around hook outputs rather than by overt malicious code in this file.
No direct malware or obfuscation is evidenced in this test module. However, the tests explicitly demonstrate that the apply_patch tool (including via orchestrator with SandboxType::None) permits directory traversal and absolute-path patch directives that write outside the intended workspace/root. If patch input can be influenced by an attacker in real usage, this constitutes a severe filesystem path confinement failure that can enable arbitrary file overwrite/delete/move—consistent with high-impact sabotage or persistence primitives.
No clear malicious payload is visible in this snippet; it is primarily a legitimate launcher/bootstrap wrapper. However, it performs multiple high-impact operations: runtime execution of Cargo (when binaries are missing), runtime execution of a local shell install script (with suppressed output and non-fatal failures), and PATH/environment manipulation to prioritize an agent-tools directory. In a threat model where the repository contents or BUT_AGENT_TOOLS_DIR (or the tools directory) can be tampered with, this could enable host compromise via binary shadowing or execution of malicious install logic. Review the contents of scripts/install-agent-ripgrep.sh and the implementations of the imported helper functions (binary_path/agent_tools_dir/etc.) to confirm they cannot download or execute unexpected artifacts.
Overall, this Python module functions as a launcher for locally executed Rust components and may also execute a repo-provided shell installer to set up an auxiliary tool. While there is no direct evidence of data theft or overt malware in the shown Python fragment, it does introduce meaningful supply-chain and operational risk: it executes build/run pipelines via cargo and runs an external shell script with suppressed output and non-fatal error handling. Security depends on the integrity of the repository (including scripts/install-agent-ripgrep.sh and the Rust crates it runs) and on whether untrusted users can influence argv/arguments passed to those binaries.