T08 · Insecure Dependencies
Error
- Location
- SKILL.md:215
- Finding
- Third-Party Browser Scripts Loaded Without Integrity Protection<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:215-216` **Vulnerability Type**: Unprotected third-party runtime dependency **Risk Level**: High ### Vulnerable Code ```html <script src="https://unpkg.com/htmx.org@1.9.12"></script> <script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/sse.js"></script> ``` ### Technical Analysis The application template loads executable JavaScript directly from the public unpkg CDN. Although a package version is specified, the resources are not protected by Subresource Integrity hashes and are not hosted as reviewed local assets. The browser consequently trusts whatever JavaScript the remote service returns at runtime. Compromise of the package publication process, the CDN, its delivery infrastructure, or the referenced package version could cause attacker-controlled JavaScript to execute in the application's origin context. This behavior also conflicts with the metadata at `SKILL.md:17-19`, which states that Langfuse tracing is the only outbound network activity. The generated browser application makes additional outbound requests to unpkg whenever the page loads. ### Attack Path 1. An attacker compromises the referenced package artifact, its publishing account, the CDN, or another part of the delivery chain. 2. The attacker modifies one of the JavaScript responses to contain a malicious browser payload. 3. A user opens an application generated from this template. 4. The browser retrieves and executes the modified script because no integrity hash verifies its contents. 5. The payload reads or modifies application content, intercepts prompts and ratings, performs authenticated same-origin requests available to the page, or exfiltrates browser-accessible data. ### Impact Assessment Successful exploitation provides JavaScript execution in the browser context of every user receiving the compromised dependency. The attacker could access prompts, generated results, ratings, DOM content, and non-`HttpOnly` b ...[truncated 428 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Download and review the required HTMX files, then serve them as version-controlled local static assets. 2. If CDN delivery is retained, use immutable URLs and add validated Subresource Integrity hashes with `integrity` and `crossorigin="anonymous"` attributes. 3. Deploy a restrictive Content Security Policy that limits `script-src` to approved local resources or explicitly hashed scripts. 4. Pin dependency versions and hashes in a reproducible dependency manifest. 5. Monitor dependency advisories and establish a controlled process for reviewing upgrades. 6. Update the Skill's network metadata to disclose all runtime outbound connections, including browser requests to unpkg. ]]>
