T09 · Insecure Skill Coding Practices
Error
- Location
- douyin-uploader.js:400
- Finding
- Chromium Is Launched with Browser Sandboxing Disabled<![CDATA[ ## Vulnerability Details **File Location**: `douyin-uploader.js`, lines 400–413 **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: High ### Vulnerable Code ```js const browser = await puppeteer.launch({ headless, slowMo: headless ? 0 : 50, args: [ '--window-size=1400,900', '--no-sandbox', '--disable-setuid-sandbox', '--disable-blink-features=AutomationControlled', '--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream', '--disable-notifications' ], defaultViewport: headless ? { width: 1400, height: 900 } : null, userDataDir: this.userDataDir, ignoreDefaultArgs: ['--enable-automation'] }); ``` ### Technical Analysis The `--no-sandbox` and `--disable-setuid-sandbox` arguments disable Chromium's process sandbox for every browser session created by the Skill. These arguments affect login, session validation, and video upload operations. The browser processes remote active content from Douyin while holding authenticated session cookies and having access to a user-selected local video. Chromium's sandbox is a defense-in-depth boundary intended to constrain a compromised renderer or browser subprocess. Disabling both available sandbox mechanisms substantially increases the consequences of a browser vulnerability. This issue does not itself demonstrate arbitrary code execution. Exploitation requires malicious or compromised remote content and a suitable Chromium vulnerability. Nevertheless, the configuration unnecessarily removes a major security control from a browser that handles sensitive authenticated sessions. ### Attack Path 1. The user invokes login, session validation, or video upload functionality. 2. Puppeteer starts Chromium with both sandbox mechanisms disabled. 3. Chromium loads active content from `creator.douyin.com`. 4. An attacker compromises the remote content path or causes the browser to process content that ...[truncated 1068 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--no-sandbox` and `--disable-setuid-sandbox` from the Puppeteer launch arguments. 2. Run Chromium as a dedicated, unprivileged operating-system user. 3. Ensure the deployment environment supports Chromium user namespaces or its setuid sandbox. 4. For containerized execution, configure namespaces, seccomp, capabilities, and filesystem isolation instead of disabling browser sandboxing. 5. Keep Puppeteer and its bundled Chromium version current through a controlled dependency-review process. 6. Where possible, place the browser process in an additional container or operating-system sandbox with access only to the required upload file and profile directory. 7. Fail safely with an explanatory error if the environment cannot launch Chromium securely, rather than automatically falling back to `--no-sandbox`. ]]>
