T03 · Remote Payload Retrieval and Execution
- Location
assets/report-template.html:7- Finding
Third-Party JavaScript Executed Without Subresource Integrity
- Content
View full analysis
Vulnerability Details
File Location:
assets/report-template.html:7
Vulnerability Type: Unverified third-party dependency loaded at runtime
Risk Level: MediumVulnerable Code
html <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>Technical Analysis
The generated HTML report loads and executes Chart.js directly from the jsDelivr CDN. Although the dependency is pinned to version
4.4.0, the script element does not include a Subresource Integrity (integrity) hash or the correspondingcrossorigin="anonymous"attribute.Consequently, the browser trusts and executes whatever JavaScript the external endpoint returns when a report is opened. The effective code is retrieved after the Skill package has been reviewed and can therefore differ from the content considered during this static audit.
The project also states that report data is embedded in the HTML. Malicious code executing in the report's origin could read rendered or embedded consultation information, modify the report, and initiate external network requests, subject to browser origin and local-file security restrictions.
Attack Path
- The Skill generates an HTML consultation report from the supplied template.
- A user opens that report in a browser with network connectivity.
- The browser requests
chart.umd.min.jsfrom jsDelivr. - An attacker who has compromised the CDN asset, its upstream package, or another relevant delivery component causes the endpoint to return modified JavaScript.
- Because no SRI hash is present, the browser cannot detect that the response differs from the reviewed asset.
- The malicious JavaScript executes in the report's browser context.
- It may alter consultation recommendations, read information embedded in the report, or attempt to transmit that information to an attacker-controlled endpoint.
Impact Assessment
Successful exploitation provides arbitrary JavaScript execution withi ...[truncated 778 chars]
- Remediation
View remediation
Remediation Suggestions
-
Preferred approach: bundle the dependency locally
- Download Chart.js from its authoritative release source.
- Verify its release checksum or signature.
- Review and store the fixed asset inside the Skill package.
- Reference the local copy so the audited package contains all executable code.
html <script src="./vendor/chart.umd.min.js"></script> -
If CDN loading is necessary, enforce Subresource Integrity
- Generate or obtain the official SHA-384 or SHA-512 digest for the exact Chart.js asset.
- Add the verified digest and
crossorigin="anonymous":
html <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js" integrity="sha384-REPLACE_WITH_VERIFIED_DIGEST" crossorigin="anonymous"></script>The placeholder must not be deployed; it must be replaced with a digest independently verified against the intended file.
-
Add a restrictive Content Security Policy
- Restrict scripts to the report itself and the explicitly approved dependency source.
- Restrict outbound connections with
connect-src. - If feasible, move inline JavaScript into a local file so
script-src 'self'can be used without allowing unsafe inline execution.
-
Maintain dependency controls
- Continue pinning exact versions.
- Periodically review Chart.js security advisories.
- Record the dependency source and verified checksum.
- Re-audit and update the bundled asset through a controlled process.
-
