T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/html-to-pdf.mjs:20
- Finding
- Chromium Sandbox Is Unconditionally Disabled<![CDATA[ ## Vulnerability Details **File Location**: `scripts/html-to-pdf.mjs:20-23` **Vulnerability Type**: Unsafe browser security configuration **Risk Level**: High ### Vulnerable Code ```javascript const CHROME_ARGS = [ '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage', '--font-render-hinting=none', '--enable-font-antialiasing' ]; ``` The arguments are subsequently used whenever Chromium is launched: ```javascript browser = await puppeteer.launch({ executablePath: CHROME_PATH, headless: true, args: CHROME_ARGS }); ``` ### Technical Analysis The script opens caller-supplied HTML in Chromium and allows the document's JavaScript and network resources to execute. Chromium is always launched with `--no-sandbox`, removing a major security boundary intended to contain a compromised renderer process. If the HTML itself, an embedded script, or a remotely loaded dependency exploits a vulnerability in the installed Chromium version, disabling the sandbox can make it substantially easier for the exploit to affect the host under the privileges of the account running this Skill. Although `SKILL.md` acknowledges that `--no-sandbox` is unsuitable for multi-tenant environments, the unsafe option is enabled by default rather than requiring an explicit opt-in. ### Attack Path 1. An attacker supplies a malicious HTML file or modifies a legitimate HTML file processed by the Skill. 2. The script launches Chromium with `--no-sandbox`. 3. Puppeteer navigates to the local HTML file and executes its active content. 4. The document or one of its remote dependencies exploits a vulnerability in the installed Chromium version. 5. Because the browser sandbox is disabled, an important containment layer is unavailable. 6. Successful exploitation can execute code or access resources with the privileges of the user running the conversion. This path depends on a suitable Chromium vulnerability; ordinary page JavaScript alone does not directly grant host code execu ...[truncated 493 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--no-sandbox` from the default Chromium arguments. 2. Run Chromium under a dedicated, unprivileged operating-system account. 3. If sandbox disabling is required in a narrowly constrained environment, require an explicit command-line or environment-variable opt-in and display a prominent warning. 4. Reject sandbox-disabled execution when running as root or in a multi-tenant service. 5. Process untrusted HTML inside an isolated container or virtual machine with: - A read-only filesystem where possible - A dedicated temporary output directory - No access to host credentials or sensitive mounts - Restricted outbound networking - CPU, memory, and execution-time limits 6. Keep Chromium patched and use a controlled, reviewed browser version. 7. Consider blocking remote resource loading unless it is explicitly required. ]]>
