T09 · Insecure Skill Coding Practices
- Location
scripts/crawl_urls.py:82- Finding
Chromium Sandbox Is Disabled by Default for Untrusted Web Content
- Content
View full analysis
list[str]: args = ["--disable-blink-features=AutomationControlled", "--disable-dev-shm-usage"] if os.environ.get("PLAYWRIGHT_NO_SANDBOX", "1").lower() not in {"0", "false", "no"}: args.extend(["--no-sandbox", "--disable-setuid-sandbox"]) return args ``` The single-page fetch helper implements the equivalent behavior: ```python launch_args = [ "--disable-blink-features=AutomationControlled", "--disable-dev-shm-usage", ] if os.environ.get("PLAYWRIGHT_NO_SANDBOX", "1").lower() not in {"0", "false", "no"}: launch_args.extend(["--no-sandbox", "--disable-setuid-sandbox"]) ``` ### Technical Analysis The scripts intentionally load JavaScript and other active resources from user-selected, potentially attacker-controlled websites. Chromium normally isolates renderer processes through operating-system sandbox mechanisms. Passing both `--no-sandbox` and `--disable-setuid-sandbox` removes this containment boundary. The environment-variable expression defaults to `"1"`, so unsafe execution occurs unless the operator explicitly overrides it. Disabling the browser sandbox is not intrinsically required for public-page crawling and exceeds the minimum privileges necessary in environments where Chromium sandboxing is available. A browser vulnerability triggered by hostile page content would ordinarily still need a sandbox escape to reach resources available to the crawler process. This configuration removes that additional security boundary. ### Attack Path 1. An attacker hosts a public page containing content designed to exploit a vulnerability in the installed Ch ...[truncated 1251 chars]- Remediation
View remediation
list[str]: args = [ "--disable-blink-features=AutomationControlled", "--disable-dev-shm-usage", ] if os.environ.get("PLAYWRIGHT_NO_SANDBOX", "0").lower() in {"1", "true", "yes"}: args.extend(["--no-sandbox", "--disable-setuid-sandbox"]) return args ``` 2. Treat unsandboxed mode as an exceptional, explicit opt-in and emit a prominent warning when it is enabled. 3. If the host cannot support Chromium's sandbox, run the entire crawler inside a hardened container or virtual machine with: - A non-root user. - A read-only root filesystem. - A dedicated writable task directory. - Dropped Linux capabilities. - A restrictive seccomp/AppArmor profile. - No host filesystem mounts containing credentials. - Network egress controls. 4. Keep Chromium updated and use a reviewed, pinned browser version. 5. Apply the correction consistently to `prepare_urls.py`, `crawl_urls.py`, and `fetch_rendered_html.py`, including the copy placed in generated skills. ]]>
