T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/generate_peep.cjs:28
- Finding
- Chromium Sandbox Disabled While Processing Remote Active Content## Vulnerability Details **File Location**: `scripts/generate_peep.cjs`, lines 28–31 **Vulnerability Type**: Chromium sandbox disabled **Risk Level**: High ### Vulnerable Code ```js const browser = await puppeteer.launch({ headless: "new", args: ['--no-sandbox', '--disable-setuid-sandbox'] }); ``` ### Technical Analysis The script launches Chromium with both `--no-sandbox` and `--disable-setuid-sandbox`, disabling important renderer-containment mechanisms. It then navigates to `https://supercoolpeeps.com/app.html?s=<seed>` and executes active content delivered by that remote site and its dependencies. Disabling the sandbox is not necessary for the documented image-generation function and weakens the security boundary between untrusted web content and the host environment. If the remote site, one of its third-party resources, or the browser renderer is compromised, a Chromium vulnerability may have substantially greater impact because the renderer is not constrained by the normal sandbox. This finding does not establish that the current remote site is malicious. The vulnerability is the unsafe browser configuration applied while processing mutable remote content. ### Attack Path 1. An attacker compromises `supercoolpeeps.com`, a resource loaded by the site, or the relevant delivery infrastructure. 2. The Skill launches Chromium with its sandbox disabled. 3. Puppeteer navigates to the affected remote page and executes attacker-controlled active content. 4. The malicious content exploits a suitable Chromium renderer vulnerability. 5. Because browser sandbox protections are disabled, the exploit may operate with the privileges and accessible resources of the Node.js process rather than remaining contained within a sandboxed renderer. ### Impact Assessment Successful exploitation could allow access to files, credentials, environment data, and network resources available to the operating-system account running the Skill. It could also permit f ...[truncated 463 chars]
- Remediation
- ## Remediation Suggestions 1. Remove `--no-sandbox` and `--disable-setuid-sandbox`, and run Chromium with its supported sandbox enabled: ```js const browser = await puppeteer.launch({ headless: "new" }); ``` 2. Run the process as a dedicated, unprivileged operating-system user with access only to the required output directory. 3. If the deployment platform cannot support Chromium's sandbox, execute the entire Skill in a disposable, hardened container or virtual machine with: - No host secrets or credential files. - No unnecessary host filesystem mounts. - A read-only root filesystem where practical. - A narrowly scoped writable output directory. - A non-root process user. - Dropped Linux capabilities and `no-new-privileges`. - Restricted outbound networking limited to required destinations. - Resource and execution-time limits. 4. Pin and regularly update Puppeteer and its compatible Chromium build so known browser vulnerabilities receive timely fixes. 5. Treat the remote page and every resource it loads as untrusted. Where feasible, restrict permitted origins and intercept requests to reject unexpected third-party destinations.
