Back to skill

Security audit

Supply Chain Optimization Amazon Lite

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it says, but its HTML report loads unpinned third-party JavaScript that can read the report's business data when opened.

Review this before installing if you plan to generate HTML reports from sensitive sales, cost, inventory, or supplier data. Text and Markdown-style reporting are lower risk; the web chart report should ideally bundle or pin Chart.js with integrity checks before use.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Warning
Location
scripts/report_html.py:51
Finding

Generated reports execute unpinned remote JavaScript

Content
View full analysis

Vulnerability Details

File Location: scripts/report_html.py:51
Vulnerability Type: Remote JavaScript retrieval and execution
Risk Level: Medium

Vulnerable Code

html
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

Technical Analysis

The generated HTML report loads Chart.js directly from jsDelivr without specifying an exact package version or providing a Subresource Integrity hash. Consequently, the JavaScript executed when a report is opened is not fully represented by the audited project files and may change after the skill has been reviewed.

Because the browser treats the downloaded resource as executable script, a compromised CDN, compromised upstream package release, unsafe package update, or sufficiently capable network trust compromise could substitute attacker-controlled JavaScript. HTTPS protects transport under normal conditions but does not protect against compromise of the CDN or upstream package.

The remote script executes in the security context of the generated report and can access its DOM, including the supply-chain metrics and business data displayed in the report. It can also alter the displayed analysis and initiate outbound network requests, subject to applicable browser security controls.

Attack Path

  1. A user generates an HTML report through generate_html_report.
  2. The resulting report retains the external script reference to the unversioned chart.js package.
  3. The user opens the report in a browser with network access.
  4. The browser requests the current Chart.js payload from jsDelivr.
  5. An attacker who has compromised the CDN, the upstream package distribution path, or another relevant trust boundary serves modified JavaScript.
  6. The browser executes that JavaScript automatically.
  7. The malicious script reads or modifies report contents and may transmit report data to an attacker-controlled endpoint.

Impact Assessment

Successf ...[truncated 712 chars]

Remediation
View remediation

Remediation Suggestions

  1. Bundle a reviewed Chart.js release within the project and reference it using a local relative path. This is the preferred remediation because reports then remain reproducible and do not execute code retrieved at viewing time.

  2. If a CDN is unavoidable, pin the dependency to an exact reviewed version rather than using the floating npm/chart.js URL.

  3. Add a verified Subresource Integrity hash and crossorigin="anonymous" to the script element, for example:

    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 a restrictive Content Security Policy that permits scripts only from explicitly approved sources. Avoid unsafe-inline; move the inline chart initialization into a separately reviewed local script.

  5. Generate reports that function offline and document all bundled third-party component versions and hashes.

  6. Establish a dependency-review process to monitor the pinned Chart.js release for disclosed vulnerabilities before upgrading it.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (11)

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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest sets lang: en, and the document footer also labels the skill as English, but the file does not clearly present language choice or opt-in in the active instructions. Since another Chinese version is referenced later, this file appears to impose a language setting rather than offering the user a locale choice.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The phrase "Or just tell me what problem you want to solve" is broad and could overlap with many ordinary user requests outside supply-chain analysis. This reduces clarity about when the skill should activate and lacks exclusion conditions or narrower trigger scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code generates the final report with fixed English headings and labels such as 'Key Metrics', 'Top 3 Bottleneck Diagnosis', and 'Summary'. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation, and there is no mechanism here for language selection or documented locale justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes a conversational supply-chain optimization skill focused on diagnosing bottlenecks and providing cost-reduction strategies. In addition to analysis, this code generates a shareable document and persists it to disk via a caller-controlled output path, which is a distinct report-generation/file-writing behavior not stated in the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a lite skill that diagnoses bottlenecks and provides cost reduction strategies through conversation. In this file, the skill generates a full HTML artifact and writes it to disk via open(..., 'w'), which is a persistent reporting/export behavior rather than conversational analysis alone.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generated report hard-codes lang="zh-CN", which imposes a specific locale on all users. This is a natural-language/locale policy issue because the file does not offer user opt-in, selection, or any justification that the skill is region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The generated report loads Chart.js from a third-party CDN at view time, introducing a supply-chain and privacy risk outside the local skill boundary. If the CDN content is tampered with, unavailable, or used for tracking, anyone opening the report may execute attacker-controlled JavaScript in their browser.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The function writes an HTML report to disk via open(output_path, 'w') and f.write(html), but the function itself provides no user-facing disclosure such as a confirmation, log message, or warning comment/docstring that it will create or overwrite a file. For code files, file writes should have some visible disclosure unless already clearly communicated elsewhere.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The generated report content hardcodes a single language/locale style and platform framing in user-facing output, with no indication that the user can choose language or locale. The policy requires flagging cases where a skill forces a specific language or locale without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code writes a generated report to disk via the provided output path, but the function includes no confirmation prompt, user-facing log, or warning comment/docstring disclosing that it will create or overwrite a file. For code files, file writes should have some visible disclosure unless clearly communicated elsewhere.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.