T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:87- Finding
Mutable Remote JavaScript Is Retrieved and Executed During Rendering
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:87andSKILL.md:124
Vulnerability Type: Remote payload retrieval and execution
Risk Level: HighThe documented and required HTML template loads snapdom directly from an unversioned third-party CDN URL:
html <script src="https://unpkg.com/@zumer/snapdom/dist/snapdom.js"></script>Technical Analysis
The URL does not pin an exact package version and does not provide a Subresource Integrity hash. Consequently, the JavaScript executed during image conversion can change after the Skill has been reviewed.
scripts/html2png.jsnavigates Puppeteer to the generated HTML, waits for the globalsnapdomobject, and invokes it inside the page. Therefore, JavaScript returned by the CDN executes in the Chromium page as an essential part of the conversion process.This creates a supply-chain execution channel controlled by infrastructure outside the project. Compromise of the package release, package owner, registry, CDN, or mutable distribution path could replace the expected library with attacker-controlled browser-side code.
Attack Path
- An attacker compromises the snapdom package distribution, package publisher, or CDN response associated with the mutable URL.
- The attacker modifies the remotely served JavaScript while retaining the expected
snapdominterface. - A user follows the Skill workflow and generates HTML containing the required external script tag.
scripts/html2png.jsopens that HTML in Puppeteer.- Chromium retrieves and executes the attacker-controlled JavaScript.
- The payload can inspect or alter the rendered document, falsify generated image content, and initiate network requests from the browser context.
- If combined with a Chromium vulnerability, the payload may attempt browser-process compromise; the disabled sandbox described separately substantially increases the consequences of such an exploit.
...[truncated 610 chars]
- Remediation
View remediation
Remediation Suggestions
- Install snapdom as a local dependency at an exact reviewed version rather than downloading executable code at render time.
- Commit and enforce a package lockfile with integrity metadata.
- Bundle the reviewed snapdom browser asset with the project and reference it through a local path.
- If a CDN is unavoidable, pin an immutable exact version and add a verified Subresource Integrity hash with an appropriate
crossoriginattribute. - Configure Puppeteer request interception to deny all network access except resources explicitly required for rendering.
- Apply a restrictive Content Security Policy to generated HTML.
- Update both occurrences in
SKILL.mdso the documented template and key requirements no longer mandate a mutable remote script. - Review and deliberately update the bundled dependency instead of accepting silent upstream changes.
