T09 · Insecure Skill Coding Practices
- Location
SKILL.md:10- Finding
Untrusted Tailwind Configuration Execution During JSON Export
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:10-15andSKILL.md:130-134
Vulnerability Type: Unsafe evaluation of untrusted JavaScript configuration
Risk Level: HighVulnerable Code
bash node -e "console.log(JSON.stringify(require('./tailwind.config.js')))" > config.json python3 scripts/tailwind_config_validator.py validate config.jsonThe same unsafe workflow is recommended for CI:
yaml run: | node -e "console.log(JSON.stringify(require('./tailwind.config.js')))" > /tmp/tw-config.json python3 scripts/tailwind_config_validator.py validate /tmp/tw-config.json --strict --format jsonTechnical Analysis
Node.js
require()does not parse a configuration file as inert data. It evaluates the target JavaScript module and any modules imported by it. Consequently, following the documented export workflow executes all top-level code intailwind.config.jsbefore the Python validator receives the generated JSON.If the project being audited is untrusted, an attacker can place arbitrary JavaScript in its Tailwind configuration. That code executes with the privileges and environment of the user or CI runner performing the audit. The Python validator itself only reads and parses JSON and does not introduce this execution behavior; the vulnerability is in the documented prerequisite workflow.
Attack Path
- An attacker creates or modifies a repository containing a malicious
tailwind.config.js. - A user or CI pipeline follows the documented command to export that configuration as JSON.
- Node.js resolves and evaluates
tailwind.config.jsthroughrequire(). - Malicious top-level code or an imported module executes before JSON serialization.
- The payload can access the runner's files, environment variables, credentials, and network using the current process privileges.
- The payload may exfiltrate secrets, alter workspace files, or compromise subsequent buil ...[truncated 661 chars]
- An attacker creates or modifies a repository containing a malicious
- Remediation
View remediation
Remediation Suggestions
- Do not evaluate configurations from untrusted repositories directly on a developer workstation or privileged CI runner.
- Require users to supply a pre-generated JSON configuration when the source cannot be trusted.
- Clearly warn that
require('./tailwind.config.js')executes arbitrary project code and is safe only for trusted projects. - If dynamic export is necessary, run it in an ephemeral sandbox or container configured with:
- No credentials or sensitive environment variables.
- Network access disabled by default.
- A non-root user with minimal privileges.
- A read-only mount for repository input.
- A separate, narrowly scoped writable output directory.
- CPU, memory, process, and execution-time limits.
- No Docker socket, host IPC, SSH agent, cloud metadata, or privileged host mounts.
- Treat the generated JSON as untrusted input and retain the Python validator's existing strict JSON parsing.
- Apply the same isolation requirements to the documented CI example rather than executing repository configuration in a secret-bearing build job.
