Back to skill

Security audit

Pine Script Developer

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly provides Pine Script help, but its bundled JavaScript can write files outside its intended folder if misused and runs a file-writing demo when executed directly.

Review carefully before installing. Do not run the bundled JavaScript or call its project generator with untrusted project names until path validation, overwrite checks, and explicit confirmation are added. Treat generated trading strategies as research examples only, not financial advice or guaranteed profitable systems.

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
PineScript工具包.js:484
Finding

Path Traversal Enables Arbitrary File Creation and Overwrite

Content
View full analysis
Remediation
View remediation
100 || !/^[\p{L}\p{N} _-]+$/u.test(projectName) || projectName === "." || projectName === ".." ) { throw new Error("Invalid project name"); } return projectName; } const safeName = validateProjectName(项目名称); const projectRoot = path.resolve(this.项目目录); const projectPath = path.resolve(projectRoot, safeName); if ( projectPath === projectRoot || !projectPath.startsWith(projectRoot + path.sep) ) { throw new Error("Project path escapes the permitted directory"); } ``` 3. **Sanitize the filename separately.** Do not assume that validation of a directory name automatically makes it safe for use as a filename. Derive the Pine Script filename from the validated basename and verify its resolved path independently. 4. **Prevent unintended overwrites.** Use exclusive creation where appropriate: ```javascript fs.writeFileSync(filePath, content, { flag: "wx" }); ``` If overwrite support is required, require an explicit trusted option and clearly report every file that will be replaced. 5. **Verify every write target.** Before each `mkdirSync()` or `writeFileSync()` call, confirm that the resolved path remains within the expected project directory. 6. **Run with least privilege.** The toolkit should not run as an administrator or privileged service account. Restrict filesystem permiss ...[truncated 329 chars]
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (6)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file consistently uses Chinese identifiers, console messages, generated README content, and a fixed zh-CN locale for dates, which effectively forces a single language/locale experience. Under the stated policy, this is a natural-language locale constraint without opt-in or a documented region-specific justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Project creation performs multiple writes to disk based on a caller-supplied project name, yet only emits routine status logs and does not provide a clear consent boundary, preview, or safety checks. In agent or automated environments, this can lead to unintended workspace modification, clutter, or overwriting of expected outputs if the capability is invoked implicitly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description and the main skill heading/content are written entirely in Chinese and present the skill as the default interaction mode, with no indication that users may choose another language. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a professional Pine Script development skill focused on writing, debugging, backtesting, and optimization of TradingView indicators and strategies. This implementation goes beyond in-memory code assistance by creating directories and writing multiple files (source, JSON config, README) to disk, which is a broader project-generation capability not stated in the description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

When the file is run directly, it automatically executes the demo, which in turn creates directories and writes project files without an explicit confirmation step. This is dangerous because simply invoking the script for inspection or testing causes side effects on the local filesystem that are not obvious from the skill description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly supports trading strategy creation, optimization, alerts, and backtesting without any warning that outputs may influence real financial decisions and carry risk. In this context, users may over-trust generated strategies or treat examples as advice, increasing the chance of harmful financial actions based on unqualified or insufficiently validated output.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.