Back to skill

Security audit

DOM Capture Engine

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent DOM-capture helper, but its examples load mutable third-party JavaScript and use a public CORS proxy without adequate privacy warnings.

Review before installing or using this skill on private or authenticated pages. Prefer pinned, locally bundled dependencies; avoid the public CORS proxy unless you fully trust it; and capture only explicitly selected DOM elements that do not contain sensitive data.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
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, and references/api_reference.md:7-10
Vulnerability Type: Remote payload retrieval and execution
Risk Level: High

Vulnerable 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

  1. An attacker compromises the upstream npm package, its publisher account, o ...[truncated 1223 chars]
Remediation
View remediation

Remediation Suggestions

  1. 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>
    
  2. Generate and verify the correct SRI hash for the exact selected artifact.
  3. Replace unversioned dynamic imports with immutable versioned URLs. Because ordinary dynamic imports do not directly support SRI, prefer locally bundled and reviewed modules.
  4. Vendor the reviewed dependency or serve it from a trusted, controlled origin where practical.
  5. Apply a restrictive Content Security Policy that limits permitted script and network origins.
  6. Regularly review pinned dependency versions and update them through a controlled security-review process.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:15
Finding

Installation Instructions Use Unpinned Third-Party npm Dependencies

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:15-18 and SKILL.md:92-95
Vulnerability Type: Insecure dependency management
Risk Level: Medium

Vulnerable Code

SKILL.md:15-18:

bash
npm i @zumer/snapdom

SKILL.md:92-95:

bash
npm install @zumer/snapdom-plugins

Technical Analysis

Both installation commands omit an exact package version. Their resolved contents therefore depend on the package release selected by npm at installation time. A future compromised, malicious, or unexpectedly incompatible release could be installed even though that release was never included in the audited project.

Dependency lockfiles can reduce this risk for an established application, but the project contains only documentation and does not provide a lockfile or verified integrity metadata. Users following the instructions directly may consequently install mutable dependency content.

Attack Path

  1. An attacker compromises an upstream package publisher account or otherwise causes a malicious package version to be published.
  2. The malicious version becomes the release selected by the unpinned npm command.
  3. A user follows the installation instructions.
  4. npm downloads and installs the malicious release.
  5. Malicious lifecycle scripts may execute during installation, or malicious library code executes when the application imports or invokes the package.
  6. The payload operates with the permissions of the npm or application process.

Impact Assessment

A malicious npm dependency could read or modify files accessible to the installing user, inspect environment variables and development credentials, alter build artifacts, make outbound network requests, or execute arbitrary commands through package lifecycle scripts. At runtime, it could also access DOM content and application data supplied to the library.

The maximum scope is limited by the privileges of the account, build runner, ...[truncated 230 chars]

Remediation
View remediation

Remediation Suggestions

  1. Specify exact reviewed versions for both packages:
    bash
    npm install --save-exact @zumer/snapdom@REVIEWED_VERSION
    npm install --save-exact @zumer/snapdom-plugins@REVIEWED_VERSION
    
  2. Commit a generated package-lock.json and use npm ci in automated builds.
  3. Verify lockfile integrity metadata and review dependency-tree changes before updates.
  4. Disable lifecycle scripts during installation where they are unnecessary:
    bash
    npm ci --ignore-scripts
    
  5. Run dependency installation and builds in a least-privileged, isolated environment without unnecessary credentials.
  6. Use automated vulnerability scanning, provenance checks, and an explicit dependency-update review process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The use-case trigger is broad enough to activate on generic screenshot, image export, or HTML-to-image requests, which can cause the agent to select this skill in contexts wider than intended. Overbroad routing increases the chance that page content, including sensitive DOM regions, is captured or exported without sufficient task scoping or user-intent validation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The demo page loads executable JavaScript directly from a third-party CDN (unpkg.com) without pinning integrity or bundling a trusted local copy. If the CDN, package, or delivery path is compromised, anyone opening the demo would execute attacker-controlled code in their browser, which is a real supply-chain risk even if this is only a demo file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The API reference documents a useProxy option for routing resource fetches through a CORS proxy but does not warn that doing so can transmit page-derived URLs and fetched third-party resources to an external service. In a DOM-capture library, this is more dangerous because captured pages commonly include sensitive internal assets, authenticated image URLs, and user-specific content, so normalizing proxy use can lead to unintended data exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The pre-cache example actively routes requests through https://proxy.corsfix.com/? without any warning about the privacy and security implications of sending asset requests to a third party. Because this library processes DOM subtrees and embedded resources, users may copy this example into applications that handle confidential UI, causing internal or user-specific resource URLs and content to be disclosed to an external proxy.

Content

No source excerpt is available for this finding.