T09 · Insecure Skill Coding Practices
- Location
scripts/collect_market_data.py:228- Finding
Chromium Sandbox Disabled for Untrusted External Content
- Content
View full analysis
Vulnerability Details
File Location:
scripts/collect_market_data.py, lines 228–250
Vulnerability Type: Browser sandbox weakening
Risk Level: MediumVulnerable Code
python _selenium_driver = None def get_selenium_driver(): """Lazy-load Selenium WebDriver only when dynamic rendering is needed.""" global _selenium_driver if _selenium_driver is None: try: from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By opts = Options() opts.add_argument("--headless=new") opts.add_argument("--disable-images") opts.add_argument("--no-sandbox") opts.add_argument("--disable-dev-shm-usage") opts.add_argument("--disable-gpu") opts.add_argument("--log-level=3") prefs = {"profile.managed_default_content_settings.images": 2} opts.add_experimental_option("prefs", prefs) _selenium_driver = webdriver.Chrome(options=opts)Technical Analysis
The collector uses Selenium to render external financial websites while passing Chromium's
--no-sandboxoption. The browser sandbox is a defense-in-depth boundary that restricts compromised renderer processes from accessing the host environment. Disabling it is not necessary for the Skill's declared market-data collection function and exceeds the minimum privileges required for browser rendering.This option does not itself create arbitrary code execution. Exploitation would require an additional browser or renderer vulnerability, or another method of compromising the browser process. However, if such a compromise occurs while an external page is being rende ...[truncated 1262 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the sandbox-disabling argument:
python opts = Options() opts.add_argument("--headless=new") opts.add_argument("--disable-images") opts.add_argument("--disable-dev-shm-usage") opts.add_argument("--disable-gpu")-
Run Chrome under a dedicated, non-administrative operating-system account with access restricted to only the required output and temporary directories.
-
If the deployment environment cannot support Chromium sandboxing, run Selenium inside a hardened container or virtual machine with:
- No host filesystem mounts except a narrowly scoped output directory.
- A read-only root filesystem where practical.
- Dropped Linux capabilities.
no-new-privilegesenabled.- Resource limits for memory, CPU, processes, and execution time.
- Network egress restricted to documented market-data domains.
-
Keep Chromium and the matching WebDriver fully patched and version-compatible.
-
Prefer direct HTTP APIs over browser rendering. If safe sandboxed rendering cannot be provided, disable the Selenium fallback rather than removing the browser security boundary.
-
Do not execute this Skill as root or an administrator.
