Back to skill

Security audit

Rollup Config Validator

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a local Rollup config checker, but its documented JavaScript conversion command can run project code on the user's machine without a clear warning.

Use this skill only for JSON config files or JSON exports you already trust. Do not let an agent run the documented Node require() conversion command on an untrusted repository unless it is inside a disposable sandbox with no secrets and no network access. Expect limited coverage for normal Rollup JS/MJS/TS configs.

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:38
Finding

Unsafe Execution of an Untrusted Rollup Configuration During Validation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 38–40
Vulnerability Type: Arbitrary code execution through unsafe configuration loading
Risk Level: High

bash
# Extract config as JSON from rollup.config.js
node -e "const c = require('./rollup.config.js'); console.log(JSON.stringify(c, null, 2))" > rollup.config.json
python3 scripts/rollup_config_validator.py validate rollup.config.json

Technical Analysis

The documented conversion command loads rollup.config.js with Node.js require(). Loading a JavaScript configuration this way executes its top-level code before the exported object is serialized or inspected.

A Rollup configuration obtained from an untrusted or compromised repository can contain arbitrary JavaScript unrelated to build configuration. Because the command provides no sandbox, privilege reduction, filesystem isolation, network restriction, or warning that the configuration must already be trusted, such code runs with the invoking user's permissions. This undermines the validator's otherwise read-only static-analysis purpose.

Attack Path

  1. An attacker commits or supplies a malicious rollup.config.js.
  2. The victim obtains the project and follows the extraction procedure documented in SKILL.md.
  3. The victim runs the provided node -e command from the project directory.
  4. Node resolves and loads ./rollup.config.js through require().
  5. Malicious top-level statements execute before JSON.stringify() processes the exported configuration.
  6. The payload performs actions available to the victim's account; it may then export an ordinary-looking object to conceal the compromise.

Impact Assessment

Successful exploitation provides arbitrary code execution with the privileges of the user running the documented command. Depending on that user's access and environment, an attacker could read credentials and source files, modify or delete files, access network r ...[truncated 270 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the require('./rollup.config.js') extraction procedure from the primary workflow because it executes the file being audited.
  2. Use a non-executing JavaScript or TypeScript parser to extract and inspect statically declared configuration data. Reject constructs that cannot be resolved safely rather than evaluating them.
  3. If evaluation is unavoidable, state explicitly that it must only be used for trusted configuration files.
  4. Run unavoidable evaluation in a disposable sandbox or container with:
    • No mounted credentials or secrets.
    • Network access disabled.
    • A read-only project mount.
    • A separate writable temporary directory.
    • A non-privileged user.
    • Strict CPU, memory, process, and execution-time limits.
  5. Keep validation separate from configuration execution and ensure the default audit path accepts only inert JSON input.
  6. Add a prominent warning explaining that Node.js configuration imports execute arbitrary top-level code.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims support for validating rollup.config.js/mjs/ts, but the described workflow actually relies on JSON serialization or JSON parsing, which can mislead users into trusting results for configuration formats the tool does not truly handle. In security or CI contexts, this can create a false sense of assurance, allowing invalid, risky, or policy-noncompliant Rollup configs to pass review because the validator silently covers only a narrower subset than advertised.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/rollup_config_validator.py validate rollup.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/rollup_config_validator.py validate rollup.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/rollup_config_validator.py validate rollup.config.json

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/rollup_config_validator.py validate rollup.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/rollup_config_validator.py validate rollup.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/rollup_config_validator.py validate rollup.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/rollup_config_validator.py validate rollup.config.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/rollup_config_validator.py validate rollup.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.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a validator for Rollup config files in JS, MJS, and TS formats, which commonly contain executable module syntax, imports, functions, and plugin expressions. This implementation strips comments and trailing commas and then calls json.loads, so it can only handle JSON-shaped data and will reject normal Rollup JavaScript/TypeScript configs.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The inline module documentation explicitly limits the tool to 'JSON format', while the skill manifest advertises support for standard Rollup config file types including JS, MJS, and TS. This is an active intent mismatch between the code documentation and the declared skill purpose.

Content

No source excerpt is available for this finding.