T09 · Insecure Skill Coding Practices
- Location
SKILL.md:13- Finding
Untrusted ESLint Configuration Is Executed During JSON Export
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 13–18 and 118–121
Vulnerability Type: Unsafe execution of untrusted configuration code
Risk Level: HighVulnerable Code
The primary export instructions at lines 13–18 state:
bash node -e "import('./eslint.config.js').then(m => console.log(JSON.stringify(m.default)))" > eslint.config.jsonThe CI integration example at lines 118–121 repeats the same unsafe operation:
yaml - name: Validate ESLint flat config run: | node -e "import('./eslint.config.js').then(m => console.log(JSON.stringify(m.default)))" > /tmp/eslint.config.json python3 scripts/eslint_flat_config_validator.py validate /tmp/eslint.config.json --strict --format jsonTechnical Analysis
The documented prerequisite uses Node.js dynamic
import()to loadeslint.config.js. Importing a JavaScript module evaluates its top-level code and loads its transitive dependencies. Consequently, this operation is not a passive conversion from configuration to JSON: it executes the target configuration with the full permissions and environment of the invoking developer or CI runner.The Skill is advertised for auditing ESLint projects and reviewing changes to
eslint.config.js, but the instructions do not warn that the target configuration must be trusted or require execution inside a restricted sandbox. A malicious configuration can therefore run arbitrary JavaScript before the Python validator receives any JSON. Validation cannot detect or prevent actions that already occurred during import.The Python validator itself does not execute the supplied JSON and contains no identified network, subprocess, persistence, environment-harvesting, or filesystem-mutation behavior. The vulnerability is specifically in the documented export workflow.
Attack Path
- An attacker submits or distributes a modified
eslint.config.js, such as through an untrusted pull request ...[truncated 1489 chars]
- An attacker submits or distributes a modified
- Remediation
View remediation
Remediation Suggestions
- Add a prominent warning that dynamic import executes the complete ESLint configuration and must only be used with trusted code.
- Do not execute configuration from untrusted pull requests on privileged, persistent, or secret-bearing CI runners.
- Perform export in a disposable sandbox or container configured with:
- An unprivileged user.
- No injected secrets or sensitive environment variables.
- Disabled outbound network access.
- A read-only repository mount.
- No host socket, home-directory, SSH-agent, or credential mounts.
- Strict CPU, memory, process, and execution-time limits.
- Destruction of the environment immediately after export.
- Prefer accepting a JSON snapshot generated in a trusted environment when reviewing untrusted projects.
- Where practical, use a non-executing static parser to inspect supported configuration syntax rather than evaluating JavaScript.
- Apply the same safeguards and warning to both the general usage instructions and the CI integration example.
