T08 · Insecure Dependencies
- Location
references/flow-template.html:7- Finding
Unpinned Third-Party JavaScript Executed Without Integrity Verification
- Content
View full analysis
``` ### Technical Analysis The flowchart template downloads and executes Mermaid JavaScript from the jsDelivr CDN whenever the HTML file is opened. The dependency is pinned only to the mutable major-version selector `@10`, rather than an exact immutable release. The script element also lacks a Subresource Integrity (`integrity`) hash. Consequently, the executable content delivered to users can change after the skill package has been reviewed. If the upstream package, publishing account, CDN, or dependency-delivery path is compromised, malicious JavaScript could be supplied and executed in the browser context of the generated flowchart. This is classified as `T08: Insecure Dependencies` because the risk arises from executing a remotely supplied third-party component without an immutable version or cryptographic integrity verification. The audited source does not demonstrate that the current Mermaid asset is malicious. ### Attack Path 1. A user creates or opens an HTML flowchart based on `references/flow-template.html`. 2. The browser requests `https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js`. 3. An attacker compromises the relevant upstream package release, package-publishing account, CDN asset, or delivery infrastructure. 4. Because the version selector is mutable and no integrity hash is enforced, the browser accepts the altered response. 5. The malicious response executes as JavaScript in the flowchart document's browser context. Successful exploitation depends on compromise or malicious alteration of the external dependency-delivery chain. ### Impact Assessment An attacker controlling the delivered script could execute arbitrary JavaScript with the pri ...[truncated 891 chars]- Remediation
View remediation
``` 2. If CDN delivery is required, pin an exact immutable version and enforce Subresource Integrity: ```html ``` 3. Obtain the integrity hash from a trusted source or calculate and independently verify it against the reviewed release artifact. 4. Add a restrictive Content Security Policy that limits script execution and outbound connections to explicitly approved sources. 5. Establish a dependency-review process covering version updates, checksums, provenance, and vulnerability advisories. 6. Prefer an offline-capable template so generated diagrams do not depend on external runtime resources. ]]>
