T08 · Insecure Dependencies
- Location
SKILL.md:134- Finding
Unpinned Third-Party JavaScript Loaded into Visualization Widgets
- Content
View full analysis
``` The surrounding example in `SKILL.md:132-136` instructs the agent to place this dependency in a rendered widget: ```html- Remediation
View remediation
/dist/chart.umd.min.js" integrity="" crossorigin="anonymous"> ``` The version and integrity value must be obtained from and verified against the selected release rather than copied from an untrusted source. 2. **Apply Subresource Integrity** Add a valid `integrity` attribute so the browser rejects content that does not match the audited artifact. Retain `crossorigin="anonymous"` where required for SRI validation. 3. **Prefer a locally bundled dependency** Store a reviewed Chart.js artifact in the trusted application distribution and load it locally. This removes runtime dependence on mutable third-party delivery infrastructure. 4. **Restrict widget capabilities** Run generated widgets in a sandboxed iframe without same-origin privileges unless strictly required. Deny access to host APIs, credentials, local storage, and sensitive DOM content. 5. **Enforce a restrictive Content Security Policy** Limit `script-src` to approved, immutable resources and disable unexpected outbound connections through restrictive `connect-src`, `img-src`, and related directives. 6. **Update all documented templates consistently** Correct the dependency reference in: - `SKILL.md:134` - `references/visualization_examples.md:11` - `references/visualization_examples.md:45` - `references/visualization_examples.md:106` 7. **Establish dependency maintenance controls** Document the approved version, review security advisories before upgrades, verify artifact hashes during updates, and avoid floating package versions in future examples. ]]>
