T03 · Remote Payload Retrieval and Execution
- Location
templates/viewer.html:23- Finding
Unverified Remote JavaScript Dependency Allows Supply-Chain Code Execution
- Content
View full analysis
``` Related instructions in `SKILL.md:280-302`: ```html ``` ```markdown **CRITICAL**: This is a single artifact. No external files, no imports (except p5.js CDN). Everything inline. ``` ### Technical Analysis The mandatory viewer template executes p5.js directly from cdnjs without a Subresource Integrity (`integrity`) attribute. It also defines no Content Security Policy restricting script execution or subsequent network communication. Although the dependency URL pins p5.js to version 1.7.0 and uses HTTPS, the browser still trusts the remote server to provide executable JavaScript each time the artifact is opened. If the CDN account, hosted asset, or upstream delivery infrastructure is compromised, the remotely supplied payload can change after the skill package has been reviewed. Generated artifacts inherit this behavior because `SKILL.md` requires the template to be used as their starting point. The template additionally loads Google Fonts remotely. These requests disclose routine connection metadata, such as the viewer's IP address and potentially referrer information, and conflict with the documentation's claim that the resulting artifact is self-contained. The font resources are not themselves demonstrated to execute malicious cod ...[truncated 1672 chars]- Remediation
View remediation
``` 3. **Apply a restrictive Content Security Policy** - Prefer bundled scripts and a policy such as `default-src 'none'`. - Explicitly allow only resources required by the artifact. - Restrict `connect-src` to prevent injected code from freely exfiltrating data. - Avoid permitting broad sources, `unsafe-eval`, or unreviewed third-party origins. 4. **Remove external font requests** - Bundle the required font files, use local fallback fonts, or embed reviewed font resources. - If remote fonts are retained, disclose the network and privacy behavior accurately. 5. **Correct the documentation** - Do not describe artifacts as completely self-contained while they require CDN and Google Fonts access. - Document every external origin, the reason it is contacted, and the integrity controls applied. 6. **Add release-time verification** - Check generated artifacts for remote scripts lacking SRI. - Maintain approved dependency hashes and review dependency updates before changing them. - Test generated artifacts with networking disabled to verify ...[truncated 35 chars]
