Back to skill

Security audit

Vite Config Validator

Security checks for vulnerabilities and agentic risk

Overview

The validator script itself is simple, but the skill tells users and CI to import Vite configs in a way that can execute untrusted project code without warning.

Install only if you will use it on Vite configs you trust, or if you first create the JSON snapshot in a sandboxed environment. Do not run the documented node import command on untrusted pull requests or in CI jobs with secrets, tokens, writable release artifacts, or broad network access.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:13
Finding

Execution of Untrusted Vite Configuration During JSON Export

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:13 and SKILL.md:116
Vulnerability Type: Arbitrary code execution through dynamic import of an untrusted configuration
Risk Level: High

The documentation instructs users to import and execute a Vite configuration to produce the JSON input consumed by the validator:

bash
node -e "import('./vite.config.ts').then(m => console.log(JSON.stringify(m.default)))" > vite.config.json

The same command is recommended for CI integration:

yaml
- name: Validate Vite config
  run: |
    node -e "import('./vite.config.ts').then(m => console.log(JSON.stringify(m.default)))" > /tmp/vite.config.json
    python3 scripts/vite_config_validator.py validate /tmp/vite.config.json --strict --format json

Technical Analysis

A JavaScript dynamic import() does not parse a configuration as passive data. It loads and evaluates the module, including all top-level statements and imported dependencies, with the privileges of the invoking Node.js process.

The Skill is presented as a tool for auditing Vite projects and reviewing changes to vite.config.ts. If the audited repository or proposed change is untrusted, an attacker can place arbitrary JavaScript in the configuration or one of its imported modules. That code executes before JSON.stringify(m.default) is reached. The Python validator itself only reads JSON and does not execute it, but the documented preprocessing procedure creates an unsafe code-execution boundary.

No sandboxing, trust warning, network restriction, filesystem isolation, or privilege reduction is specified. In CI, the imported configuration may consequently run with access to repository contents, writable build workspaces, job tokens, environment variables, and any secrets exposed to the job.

Attack Path

  1. An attacker supplies a repository, pull request, or configuration change containing malicious top-level code in `vite.config.t ...[truncated 1226 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not dynamically import configuration files from untrusted repositories on a developer workstation or privileged CI runner.
  2. Prefer static parsing of supported Vite configuration syntax. Extract object-literal values without evaluating JavaScript, and explicitly report constructs that cannot be analyzed statically.
  3. If evaluation is unavoidable, run it in a disposable, hardened sandbox or container configured with:
    • A non-root user and no additional Linux capabilities.
    • No mounted host credentials, agent sockets, package-manager tokens, or cloud metadata access.
    • A read-only source mount and a separate, minimally scoped output directory.
    • No network access unless strictly required.
    • A clean environment without CI or deployment secrets.
    • CPU, memory, process, and execution-time limits.
    • A disposable filesystem destroyed after evaluation.
  4. Separate validation of untrusted pull requests from trusted release jobs. Do not expose secrets to jobs that evaluate contributor-controlled configuration.
  5. Add a prominent warning immediately before every export example stating that importing vite.config.ts executes arbitrary project code and is safe only for trusted repositories.
  6. Consider requiring users to generate the JSON snapshot in an already trusted development environment and validate only the resulting inert JSON in security-sensitive workflows.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 23)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 24)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 25)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 32)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 45)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 135)May include surrounding context.

md
python3 scripts/vite_config_validator.py validate vite.config.json

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
60% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/vite_config_validator.py (reported line 268)May include surrounding context.

python
elif port_int < 1024:
                findings.append(Finding("V1", "warning",
                    f"server.port {port_int} is a privileged port (<1024)",
                    "Privileged ports require root access. Use a port >= 1024."))
        else:
            findings.append(Finding("V1", "error",
                f"server.port must be a number, got {type(port).__name__}",