T09 · Insecure Skill Coding Practices
Error
- Location
- index.js:40
- Finding
- Chromium Sandbox Protections Are Explicitly Disabled<![CDATA[ ## Vulnerability Details **File Location**: `index.js:40-46` **Vulnerability Type**: Browser execution without process sandboxing **Risk Level**: High Equivalent unsafe flags also appear in `index.ts:124-130` and `dist/index.js:78-84`. ### Vulnerable Code ```javascript const userDataDir = path.join(os.homedir(), '.config', 'google-chrome'); context = await chromium.launchPersistentContext(userDataDir, { headless: false, viewport: null, executablePath: '/usr/bin/brave-browser', args: ['--no-sandbox'] }); ``` The TypeScript implementation disables additional protections: ```typescript const userDataDir = `/home/shuttle/.config/google-chrome`; const context = await chromium.launchPersistentContext(userDataDir, { headless: false, viewport: null, executablePath: '/usr/bin/brave-browser', args: [ '--no-sandbox', '--disable-setuid-sandbox', '--disable-blink-features=AutomationControlled' ] }); ``` ### Technical Analysis The Skill launches Brave with `--no-sandbox`; the TypeScript and compiled implementations also use `--disable-setuid-sandbox`. These flags disable important Chromium containment boundaries intended to prevent compromised renderer processes from directly accessing the host environment. The browser renders remote content from X/Twitter and Facebook. Although these are expected destinations, profile content remains remotely controlled, and the browser must process complex HTML, JavaScript, images, video, fonts, and other resources. If any of that content exploits a browser-engine vulnerability, disabling the sandbox can turn a renderer compromise into host-level code execution under the account running the Skill. The risk is amplified because the browser is launched with a persistent authenticated profile rather than a disposable, minimally privileged profile. ### Attack Path 1. An attacker controls or compromises a social-media account that the user asks the Skill to inspect. 2. The Skill fails to ...[truncated 1366 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--no-sandbox` and `--disable-setuid-sandbox` from every implementation: - `index.js` - `index.ts` - `dist/index.js` 2. Fail closed if the browser cannot start with its normal sandbox protections instead of automatically weakening security. 3. Run browser automation under a dedicated, low-privilege operating-system account. 4. Use a container or similarly isolated runtime with a restrictive filesystem and network policy as defense in depth. 5. Use a dedicated browser profile containing only the minimum sessions required for this Skill. 6. Keep Brave/Chromium and Playwright patched to supported versions. 7. Regenerate `dist/index.js` from the corrected TypeScript source to prevent source/build divergence. ]]>
