T03 · Remote Payload Retrieval and Execution
Warning
- Location
- assets/templates/problem.html:6
- Finding
- Unpinned Remote JavaScript Executes During Local Slide Rendering<![CDATA[ ## Vulnerability Details **File Locations**: - `assets/examples/01-problem-v2.html:6-7` - `assets/examples/02-solution-v2.html:6-7` - `assets/examples/03-gaptype-v2.html:6-7` - `assets/templates/compare.html:6-7` - `assets/templates/matrix.html:6-7` - `assets/templates/problem.html:6-7` - `assets/templates/solution.html:6-7` **Vulnerability Type**: Unpinned remote payload retrieval and supply-chain exposure **Risk Level**: Medium **Vulnerable Code**: ```html <script src="https://cdn.tailwindcss.com"></script> <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700;900&display=swap" rel="stylesheet"> ``` The affected HTML files are rendered through the following command in `scripts/html2png.sh:13-16`: ```bash google-chrome --headless --disable-gpu \ --screenshot="$OUTPUT" \ --window-size=1200,675 \ "file://$INPUT" 2>/dev/null ``` ### Technical Analysis Each supplied HTML template and example loads JavaScript from `https://cdn.tailwindcss.com` at rendering time. The URL is not pinned to an immutable version, and no Subresource Integrity metadata is provided. Consequently, the code that executes in headless Chrome can change after the Skill package has been reviewed. This is a remote payload execution channel rather than a purely static stylesheet dependency. When `html2png.sh` opens a generated slide, Chrome retrieves the current CDN response and executes it in the local slide page. If the CDN, its delivery path, or the referenced resource is compromised, attacker-controlled JavaScript could execute in the page context. The Google Fonts stylesheet also creates an outbound dependency and reduces rendering determinism, although the reviewed project does not contain evidence that it directly transmits sensitive slide data. No currently malicious CDN payload or deliberate exfiltration logic was found in the repository. The vulnerability is the trust placed in mutable remote code during local rendering. ### Attac ...[truncated 1534 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the runtime Tailwind CDN script from every template and example. 2. Compile Tailwind CSS ahead of time and ship the generated static CSS as a local, reviewed asset. 3. Reference bundled CSS through a local path so slide rendering does not require network access. 4. Bundle the required Noto Sans JP font files locally when confidential or reproducible rendering is required. 5. If a remote resource is unavoidable: - Pin it to an immutable version. - Use Subresource Integrity with a verified cryptographic hash. - Set an appropriate `crossorigin` attribute. - Apply a restrictive Content Security Policy. 6. Run headless Chrome in a sandboxed environment with outbound network access disabled. 7. Add an automated check that rejects remote `<script>` elements and unexpected external resource URLs in generated slides. 8. Revalidate screenshots after dependency updates and retain reviewed dependency artifacts to support reproducible builds. ]]>
