T09 · Insecure Skill Coding Practices
Warning
- Location
- references/examples-web-ts.md:32
- Finding
- Chromium Sandbox Disabled by Default## Vulnerability Details **File Location**: `references/examples-web-ts.md`, lines 32–35 **Vulnerability Type**: Browser process isolation disabled **Risk Level**: Medium ### Vulnerable Code ```typescript this.browser = await chromium.launch({ headless: options.headless ?? false, args: ["--no-sandbox", "--disable-setuid-sandbox"], }); ``` ### Technical Analysis The example launches Chromium with both `--no-sandbox` and `--disable-setuid-sandbox`. These flags disable Chromium's process sandbox, removing an important defense-in-depth boundary between untrusted web content and the host environment. The same example later navigates to the caller-controlled `options.url`. If the selected website is malicious or compromised, its content is processed by a browser running without normal sandbox isolation. Exploitation still requires a suitable Chromium or rendering-engine vulnerability; the flags do not independently provide arbitrary code execution. However, they can substantially increase the impact of such a vulnerability by weakening containment. ### Attack Path 1. A user copies or runs the Web automation example. 2. Chromium starts with its sandbox protections disabled. 3. The automation navigates to an attacker-controlled or compromised URL through `options.url`. 4. Malicious content exploits a browser or rendering-engine vulnerability. 5. Because sandbox isolation is disabled, the exploit may access resources available to the browser process without first overcoming Chromium's normal sandbox boundary. ### Impact Assessment Successful exploitation could allow execution with the privileges of the account running the automation. Depending on that account's permissions and environmental controls, an attacker could potentially access readable local files, authentication state, environment variables, or network resources available to the process. The issue does not directly grant elevated operating-system privileges. Its practical scope is limited by t ...[truncated 128 chars]
- Remediation
- ## Remediation Suggestions 1. Remove `--no-sandbox` and `--disable-setuid-sandbox` so Chromium uses its default sandbox: ```typescript this.browser = await chromium.launch({ headless: options.headless ?? false, }); ``` 2. If a constrained runtime cannot support Chromium's sandbox, treat sandbox disabling as an explicit exceptional configuration rather than the default. 3. Run browser automation as a dedicated, unprivileged operating-system user. 4. Use a strongly isolated container or virtual machine with minimal filesystem mounts, restricted network access, dropped Linux capabilities, and no host credentials. 5. Keep Chromium and Playwright updated with current security patches. 6. Validate or allowlist navigation targets when URLs can originate from untrusted input. 7. Avoid exposing sensitive environment variables and reusable authenticated browser state to browser automation that may visit untrusted sites.
