Back to skill

Security audit

Chartjs

Security checks for vulnerabilities and agentic risk

Overview

This Chart.js skill is a straightforward chart-generation reference with normal dependency and output caveats, not hidden or destructive behavior.

Install only if you want Chart.js chart-generation help. Prefer pinned package versions, lockfiles, and versioned CDN URLs with integrity hashes, and confirm where generated HTML, image, or PDF files will be written.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:18
Finding
Unpinned Third-Party Dependencies and Mutable CDN Resource<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 18-26 and 125-129 **Vulnerability Type**: Unpinned npm dependencies and CDN resource without Subresource Integrity **Risk Level**: Medium ### Vulnerable Code ```markdown **npm:** ```bash npm install chart.js ``` **CDN (Script Tag):** ```html <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> ``` ``` The time-scale guidance also references dependencies without specifying reviewed versions: ```javascript import moment from 'moment'; import 'chartjs-adapter-moment'; // Then configure scales with type: 'time' ``` ### Technical Analysis The installation command does not pin Chart.js to an exact reviewed version. The CDN URL likewise omits a version and Subresource Integrity hash, meaning the JavaScript returned by the external service can change after the Skill has been audited. The date-adapter guidance also fails to prescribe exact versions for `moment` and `chartjs-adapter-moment`. This creates a supply-chain trust gap: the code ultimately installed or executed is determined by mutable registry metadata or CDN responses rather than by immutable, reviewed artifacts. Normal upstream updates are not inherently malicious, but compromise of a package maintainer account, npm publication process, CDN, DNS path, or upstream release could cause altered code to be delivered. ### Attack Path 1. An attacker compromises an upstream package publication account, distribution service, or other part of the dependency supply chain. 2. The attacker publishes or serves a malicious version under one of the unpinned dependency names or mutable CDN paths. 3. A user follows the Skill's installation or HTML-generation instructions. 4. The package manager resolves the unpinned dependency to the affected release, or the browser downloads the modified CDN script. 5. The malicious content executes: - Package lifecycle code may run with the privileges of the user performing installation. - Bundl ...[truncated 958 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every npm dependency to an exact reviewed version rather than a floating range: ```bash npm install --save-exact chart.js@<reviewed-version> npm install --save-exact moment@<reviewed-version> chartjs-adapter-moment@<reviewed-version> ``` 2. Commit and enforce a package lockfile containing resolved versions and integrity hashes. Use deterministic installation in automated environments: ```bash npm ci ``` 3. Replace the mutable CDN URL with an exact version and a verified Subresource Integrity hash: ```html <script src="https://cdn.jsdelivr.net/npm/chart.js@<exact-version>/dist/chart.umd.min.js" integrity="sha384-<verified-hash>" crossorigin="anonymous"></script> ``` 4. Add an appropriate Content Security Policy that restricts permitted script sources. Where practical, self-host the reviewed library artifact. 5. Enable dependency vulnerability scanning and update pinned versions through a controlled review process. Verify package provenance, integrity, ownership, and release notes before accepting upgrades. 6. Document that generated HTML must not interpolate untrusted input directly into JavaScript or markup, especially when dependency code runs in a page containing sensitive application data. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger list includes broad phrases such as 'create/generate/draw a chart' and 'visualize data with a chart' without constraints or negative examples. In a markdown skill description, this can cause unintended invocation because these requests overlap with common everyday analytical or presentation tasks.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The markdown describes generating a complete HTML file and possibly creating image/PDF output with puppeteer/canvas, which can affect user files or system execution context. There is no accompanying warning or disclosure about file creation, browser automation, or confirming output location before proceeding.

Static analysis

No suspicious patterns detected.