T08 · Insecure Dependencies
- Location
templates/en/dark-tech.html:7- Finding
Generated reports execute mutable third-party JavaScript without integrity protection
- Content
View full analysis
Vulnerability Details
File Location:
templates/en/dark-tech.html:7-9, 963-976
Vulnerability Type: Third-party JavaScript supply-chain exposure
Risk Level: MediumVulnerable Code
html <script src="https://cdn.jsdelivr.net/npm/chart.js@4/dist/chart.umd.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>javascript /* Preload html2canvas eagerly — fires while user reads, so first export is instant */ let libPromise = null; function loadLib() { if (libPromise) return libPromise; libPromise = new Promise(resolve => { if (window.html2canvas) { resolve(); return; } const s = document.createElement('script'); s.src = 'https://cdn.jsdelivr.net/npm/html2canvas@1/dist/html2canvas.min.js'; s.onload = resolve; document.head.appendChild(s); }); return libPromise; } loadLib(); /* start loading immediately */The same design is prescribed in
references/html-shell/export.md:51,references/rendering/chart.md:7, andreferences/rendering/media-code-callout.md:21, and appears in multiple English and Chinese templates.Technical Analysis
Generated reports execute JavaScript obtained from third-party CDNs. Some dependencies use mutable major-version selectors such as
@1,@4,@5, and@11, and the static imports do not provide Subresource Integrity metadata. Consequently, the executable content delivered to a report can change after the Skill package has been audited.The
html2canvasdependency is loaded eagerly when the report opens rather than only after the user requests an export. This creates an external request and grants third-party code access to the report's browser context even when image export is never used.The inspected export code does not explicitly ...[truncated 1613 chars]
- Remediation
View remediation
Remediation Suggestions
- Make bundled, locally audited dependencies the default for generated reports.
- Pin every browser dependency to an exact reviewed version rather than a major-version selector.
- Add
integrityhashes andcrossorigin="anonymous"to static CDN script and stylesheet imports when remote loading remains supported. - Load
html2canvasonly after an explicit user click on an image-export action; remove the eagerloadLib()invocation. - Apply a restrictive Content Security Policy. In particular, constrain
script-src,connect-src,img-src, andstyle-srcto the minimum required sources. - Ensure bundled dependencies are obtained through a reproducible process with checksums or a lock file, and review dependency updates before release.
- Clearly disclose that non-bundled reports contact third-party CDNs and may therefore be inappropriate for confidential or offline reports.
- Add automated quality-gate checks that reject mutable CDN version selectors and external scripts lacking approved integrity hashes.
