T09 · Insecure Skill Coding Practices
- Location
html2pdf.cjs:42- Finding
Chromium Sandbox Disabled While Rendering Active HTML
- Content
View full analysis
Vulnerability Details
File Location:
html2pdf.cjs, lines 42–46
Vulnerability Type: Browser sandbox disabled for active HTML rendering
Risk Level: HighVulnerable Code
javascript const browser = await puppeteer.launch({ executablePath: '/usr/bin/chromium-browser', headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'] });Technical Analysis
The converter opens HTML in Chromium with JavaScript enabled while explicitly disabling both Chromium's process sandbox and setuid sandbox. The script does not implement request interception, network restrictions, or other isolation controls for the rendered document.
Rendering HTML is required for the declared PDF-conversion functionality, but disabling both sandbox mechanisms exceeds what is necessary. If slide content, embedded scripts, or referenced resources are attacker-controlled, that content executes inside a materially weakened browser security boundary. Remote resources can also be loaded because the page is opened with
waitUntil: 'networkidle0'and no outbound-request policy is configured.Exploitation beyond browser-context behavior would generally require a compatible Chromium vulnerability, but disabling the sandbox increases the consequences of such a vulnerability.
Attack Path
- An attacker influences the HTML slide deck or causes it to reference attacker-controlled JavaScript or other active content.
- The user or Agent invokes
html2pdf.cjsto convert the document. - Chromium loads and executes the active content.
- The browser operates with both
--no-sandboxand--disable-setuid-sandbox. - The malicious content initiates unintended network activity or exploits a compatible Chromium vulnerability.
- A successful browser exploit can escape the renderer without the normal Chromium sandbox barrier and act with the privileges of the account running the Skill.
Impact Assessment
At minimum, attacker-control ...[truncated 462 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
--no-sandboxand--disable-setuid-sandbox, and configure the host so Chromium's supported sandbox can operate. - Run conversion as a dedicated, unprivileged operating-system user with access only to the input file, output directory, Chromium dependencies, and required fonts.
- Place each conversion in a short-lived container or equivalent isolation boundary with a read-only root filesystem, dropped Linux capabilities, resource limits, and no access to Agent credentials.
- Block outbound network access by default. If remote assets are required, use Puppeteer request interception and an explicit allowlist of trusted schemes and hosts.
- Disable JavaScript where slide rendering does not require it. Otherwise, reject unexpected scripts and sanitize untrusted HTML before rendering.
- Restrict local navigation and resource loading to the intended input document and approved local assets.
- Keep Chromium patched and ensure the Puppeteer/Chromium versions are compatible and maintained.
- Close Chromium in a
finallyblock so failures do not leave residual browser processes.
- Remove
