T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/launch_browser.py:23
- Finding
- Chrome Sandbox Disabled While Loading User-Controlled URLs<![CDATA[ ## Vulnerability Details **File Location**: `scripts/launch_browser.py:19-23, 43-44` **Vulnerability Type**: Browser isolation weakening **Risk Level**: Medium ### Vulnerable Code ```python chrome_options = Options() if args.headless: chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-dev-shm-usage") ``` The browser subsequently navigates to a user-supplied URL: ```python # Open URL driver.get(args.url) ``` The unsafe option is also shown in the example implementation at `SKILL.md:43-49`: ```python chrome_options = Options() if args.headless: chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-dev-shm-usage") ``` ### Technical Analysis The `--no-sandbox` argument disables important Chrome process-isolation protections. The script accepts its destination through the positional `url` command-line argument and passes that value directly to `driver.get()`. Consequently, potentially attacker-controlled web content is loaded inside a browser whose operating-system-level sandbox has been disabled. This flag does not, by itself, provide remote code execution. Exploitation would additionally require a suitable Chrome or renderer vulnerability. However, if such a vulnerability is triggered, disabling the sandbox can reduce containment and make access to the browser process's host privileges and resources substantially easier. ### Attack Path 1. An attacker causes a user or calling agent to invoke the skill with an attacker-controlled URL. 2. The script starts Chrome with the `--no-sandbox` argument. 3. Selenium navigates Chrome to the attacker's page through `driver.get(args.url)`. 4. The page serves content designed to exploit a vulnerability in the installed Chrome version. 5. Because the Chrome sandbox is ...[truncated 663 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove `chrome_options.add_argument("--no-sandbox")` from both the actual script and the documented example. - Run Chrome as a dedicated, unprivileged operating-system user. - Place browser execution in a hardened container or virtual machine with a read-only root filesystem, restricted mounts, dropped Linux capabilities, and no access to application secrets. - Restrict outbound and internal network access where arbitrary URLs are not required. - Apply a URL policy that permits only expected schemes and, where practical, approved destinations. - Keep Chrome and ChromeDriver updated to reviewed, compatible versions. - If `--no-sandbox` is unavoidable in a specific container environment, document that exception and enforce an equivalent outer isolation boundary rather than enabling it by default. ]]>
