T09 · Insecure Skill Coding Practices
- Location
scripts/data-fetcher.mjs:72- Finding
Chromium Sandbox Disabled While Processing Untrusted External Content
- Content
View full analysis
Vulnerability Details
File Location:
scripts/data-fetcher.mjs:72-75,scripts/data-fetcher.mjs:124-127,scripts/data-fetcher.mjs:176-179, andscripts/data-fetcher.mjs:212-215
Vulnerability Type: Browser sandbox bypass through unsafe Puppeteer configuration
Risk Level: HighVulnerable Code
javascript browser = await puppeteer.launch({ headless: 'new', args: ['--no-sandbox', '--disable-setuid-sandbox'] });The same unsafe launch configuration is used by the Maoyan, Damai, Meituan, and Xiaohongshu scraping functions.
Technical Analysis
The Puppeteer configuration explicitly disables Chromium's operating-system process sandbox and setuid sandbox. These security boundaries normally isolate browser renderer processes from the host account and filesystem.
Each browser subsequently navigates to externally controlled websites and processes their pages, scripts, advertisements, and third-party resources. If any loaded content exploits a vulnerability in the bundled Chromium version, disabling the sandbox can allow the exploit to escape the renderer directly into the Node.js process's host security context.
This configuration is especially risky in an agent environment because the Node.js process may have access to project files, user files, environment variables, browser data, API credentials, or other agent resources.
Attack Path
- An attacker compromises one of the target websites, a third-party script, advertising resource, or another resource loaded by the page.
- The Skill launches Chromium with both sandbox mechanisms disabled.
- Puppeteer navigates to the compromised content.
- The hostile page exploits a compatible Chromium renderer vulnerability.
- Because Chromium is running without its process sandbox, the payload executes with the permissions of the Node.js process.
- The payload may access files, environment variables, credentials, and network resources ava ...[truncated 1003 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove
--no-sandboxand--disable-setuid-sandbox, allowing Chromium to use its normal process isolation:javascript browser = await puppeteer.launch({ headless: 'new' }); -
Configure the deployment host so Chromium's sandbox is supported rather than disabling it to work around environment limitations.
-
If sandboxed Chromium cannot be supported, run scraping inside a dedicated unprivileged container or virtual machine with:
- A non-root user.
- A read-only root filesystem.
- No mounted credentials or sensitive host directories.
- A minimal writable temporary directory.
- Restricted outbound networking limited to required domains.
- Dropped Linux capabilities and a restrictive seccomp/AppArmor profile.
-
Keep Puppeteer and its bundled Chromium version patched and regularly monitor browser security advisories.
-
Reuse one hardened browser instance where practical instead of repeatedly creating independently configured unsafe instances.
-
Block unnecessary third-party requests, downloads, pop-ups, and navigation to domains outside an explicit allowlist.
-
