T03 · Remote Payload Retrieval and Execution
- Location
assets/demo.html:73- Finding
Mutable Remote JavaScript Is Retrieved and Executed Without Integrity Verification
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:21-23,SKILL.md:78-85,assets/demo.html:73, andreferences/api_reference.md:7-10
Vulnerability Type: Remote payload retrieval and execution
Risk Level: HighVulnerable Code
SKILL.md:21-23:html <script src="https://unpkg.com/@zumer/snapdom/dist/snapdom.js"></script>SKILL.md:78-85:js await browser.evaluate(async (selector) => { const { snapdom } = window._snapdom || await import('https://unpkg.com/@zumer/snapdom/dist/snapdom.mjs'); const el = document.querySelector(selector); if (!el) throw new Error(`Element not found: ${selector}`); const result = await snapdom(el, { scale: 2, embedFonts: true }); const dataUrl = await result.toPng(); return dataUrl; }, selector);assets/demo.html:73:html <script src="https://unpkg.com/@zumer/snapdom/dist/snapdom.js"></script>references/api_reference.md:7-10:js // CDN ESM import { snapdom } from 'https://unpkg.com/@zumer/snapdom/dist/snapdom.mjs';Technical Analysis
The documented examples retrieve executable JavaScript directly from unpkg without specifying an immutable package version. The classic script tags also omit a Subresource Integrity hash. The effective code executed by these examples can therefore change after the Skill has been reviewed.
The dynamic import is particularly sensitive because it executes the downloaded module inside the browser evaluation context. A malicious package release, compromised package-publishing account, or compromised CDN delivery path could replace the expected SnapDOM implementation with attacker-controlled JavaScript.
Although the audited project does not itself contain a malicious payload, these instructions establish a mutable remote-code execution channel.
Attack Path
- An attacker compromises the upstream npm package, its publisher account, o ...[truncated 1223 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin CDN resources to an exact, reviewed package version, for example:
html <script src="https://unpkg.com/@zumer/snapdom@REVIEWED_VERSION/dist/snapdom.js" integrity="sha384-EXPECTED_HASH" crossorigin="anonymous"></script> - Generate and verify the correct SRI hash for the exact selected artifact.
- Replace unversioned dynamic imports with immutable versioned URLs. Because ordinary dynamic imports do not directly support SRI, prefer locally bundled and reviewed modules.
- Vendor the reviewed dependency or serve it from a trusted, controlled origin where practical.
- Apply a restrictive Content Security Policy that limits permitted script and network origins.
- Regularly review pinned dependency versions and update them through a controlled security-review process.
- Pin CDN resources to an exact, reviewed package version, for example:
