T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/arxiv_crawler_search.py:143- Finding
Full Host Environment Inherited by Third-Party Crawler Browser Processes
- Content
View full analysis
Vulnerability Details
File Location:
scripts/arxiv_crawler_search.py:143-149
Vulnerability Type: Excessive environment-variable exposure to a child process
Risk Level: MediumVulnerable Code
python options = camoufox_launch_options(headless=headless) playwright = await async_playwright().start() browser = await playwright.firefox.launch( executable_path=options["executablePath"], headless=options.get("headless", headless), args=options.get("args") or [], env={**os.environ, **(options.get("env") or {})}, firefox_user_prefs=options.get("firefoxUserPrefs") or {}, proxy=options.get("proxy") or None, )Technical Analysis
The crawler forwards the complete host environment to a browser executable whose path and launch options are supplied by the external
camoufox-jsdependency. Academic crawling does not require unrelated environment variables such as cloud credentials, CI tokens, database passwords, or API keys for other services.This violates least privilege by making every inherited environment variable readable by the browser process. The code does not itself transmit those values, so exploitation depends on a compromised, malicious, or substituted Camoufox/browser component.
Attack Path
- An attacker compromises the installed
camoufox-jspackage, its generated configuration, or the browser executable it selects. - The official academic provider fails, causing the crawler fallback to run, or the crawler is invoked directly.
camoufox-jssupplies an attacker-controlled or compromisedexecutablePath.- Playwright starts that executable with
env={**os.environ, ...}. - The child process reads unrelated credentials from its inherited environment.
- Because the browser already requires network access, a malicious executable can transmit those credentials externally.
Impact Assessment
A compromised child process can read every environment variable available to the parent Agent proc ...[truncated 434 chars]
- An attacker compromises the installed
- Remediation
View remediation
Remediation Suggestions
- Replace full environment inheritance with a minimal allowlist containing only variables required to launch the browser, such as
PATH, selected locale variables, and explicitly documented browser settings. - Never pass unrelated API keys, cloud credentials, CI variables, or database secrets to crawler processes.
- Validate and canonicalize
options["executablePath"]; require it to resolve to an approved browser installation. - Run crawler fallbacks in a sandbox or container with restricted filesystem access, a sanitized environment, and destination-limited network egress.
- Pin and verify the
camoufox-jspackage and browser artifacts. - Add an automated test asserting that sensitive environment variables are absent from the child-process environment.
- Replace full environment inheritance with a minimal allowlist containing only variables required to launch the browser, such as
