Back to skill

Security audit

Svelte

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Svelte/SvelteKit developer guidance skill with disclosed preference memory and some unpinned developer-tool commands users should review before running.

Before installing, be aware that this skill may read and update Svelte-specific preference files under ~/Clawic/data/svelte/. Treat its npx examples as commands to review first: prefer project-local, lockfile-pinned tools or explicit package versions in sensitive environments.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
debug.md:8
Finding

Unpinned Third-Party Package Execution Through npx

Content
View full analysis

Vulnerability Details

File Location: debug.md:8
Additional Locations: library.md:18,44; migration.md:8; performance.md:27; styling.md:76; testing.md:10,124-126; typescript.md:82-85
Vulnerability Type: Supply-chain exposure through unpinned package execution
Risk Level: Medium

Vulnerable Code Snippet:

markdown
2. **Read the compiler output.** `non_reactive_update`, `css_unused_selector`, `state_referenced_locally`, and the a11y warnings each name the bug directly. Warnings scroll past in the dev server; run `npx svelte-check` to see them all at once.

Other affected instructions recommend commands such as:

text
npx sv create my-lib
npx publint
npx sv migrate svelte-5
npx vite-bundle-visualizer
npx sv add tailwindcss
npx sv add vitest
npx vitest run --coverage
npx playwright test
npx svelte-kit sync

Technical Analysis

The Skill repeatedly recommends executing packages through npx without requiring a locally installed, lockfile-pinned version. If a requested executable is absent from the project, npx may resolve and download a package from the configured npm registry and immediately execute its CLI code.

This creates a mutable supply-chain boundary: the code executed by the user can differ from the code available when the Skill was reviewed. A compromised package release, package takeover, registry compromise, dependency-confusion condition, or malicious registry configuration could therefore result in arbitrary local code execution.

The commands are relevant to Svelte development, and there is no evidence that the named packages are intentionally malicious. The risk arises from automatic resolution and execution of unpinned third-party code rather than from an embedded malicious payload.

Attack Path

  1. The user follows the Skill's recommendation to run an unpinned npx command.
  2. The corresponding CLI package is not already installed in ...[truncated 1452 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add required developer tools to the project's devDependencies using reviewed, exact or policy-approved versions.

  2. Commit and enforce the package-manager lockfile so dependency resolution is reproducible.

  3. Prefer execution of project-local binaries. For npm environments, use a locked installation followed by commands such as:

    sh
    npm ci
    npm exec --offline -- svelte-check
    npm exec --offline -- vitest run --coverage
    npm exec --offline -- playwright test
    
  4. When introducing a new package, require explicit user confirmation and specify a reviewed version rather than resolving an unspecified latest release.

  5. Verify the package name, publisher, registry, integrity metadata, and provenance before installation.

  6. In CI, use immutable lockfile installation, disable unexpected lifecycle scripts where feasible, and run dependency tooling with minimal filesystem and credential access.

  7. Update the Skill documentation to distinguish commands that use an existing local dependency from commands that may download and execute remote code.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (26)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 59)May include surrounding context.

md
| Routes, layouts, groups, param matchers, navigation, shallow routing | `routing.md` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 63)May include surrounding context.

md
| Login, sessions, cookies, route guards, roles, CSRF, XSS, CSP, leaked secrets | `security.md` |

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · memory-template.md (reported line 13)May include surrounding context.

md
last: YYYY-MM-DD

## Project
<!-- Svelte-only or SvelteKit; svelte and @sveltejs/kit versions; adapter -->
<!-- Syntax mode in practice: runes, legacy, or mid-migration and which parts are converted -->

## Stack

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · security.md (reported line 105)May include surrounding context.

md
|---|---|---|
| `{@html value}` | Stored XSS from user content, and scoped styles do not apply to it | Sanitize on the server with an allowlist sanitizer, store the sanitized copy, style with `:global` |
| `?next=` after login | Open redirect to a phishing clone | Accept only a path starting with `/` and not `//` or `/\`; reject absolute URLs |
| `[...path]` file routes | Traversal to `../../etc/passwd` | Resolve against a base directory and verify the resolved path is still inside it |
| SQL/ORM string interpolation | Injection | Parameterized queries; the ORM's raw escape hatch is where this reappears |
| JSON `+server.js` with cookie auth | Kit's origin check targets form-encoded submissions, so a JSON endpoint authenticated purely by cookie is the CSRF gap | `sameSite` cookie plus a required custom header or token, or keep the mutation in a form action |
| Uploaded files | Content type from the extension, executed on serve | Validate from the bytes, store outside the served root or in object storage, serve with `content-disposition` |

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The document instructs users to run npx sv migrate svelte-5 without pinning an explicit package version. npx resolves and executes the latest matching package from the registry at runtime, which can introduce supply-chain risk if a malicious or compromised release is published, or if behavior changes unexpectedly between runs. In a migration guide, readers are especially likely to copy-paste commands directly, which makes this more dangerous than a non-executable reference.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The upgrade table recommends npx sv create without a pinned version, which causes execution of whatever package version is current at the time the reader runs it. That creates a supply-chain and reproducibility risk: a compromised publish or simply a breaking new release could execute unexpected code or produce materially different project scaffolding. Because this is instructional content for developers, copy-paste execution likelihood is high.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
86% confidence
Finding

The guidance to run npx svelte-check is unpinned, so it may download and execute the latest package version from the registry at runtime. This exposes users to supply-chain compromise and non-reproducible behavior, particularly in CI or when following documentation verbatim. The skill context increases risk because the file is a migration guide containing shell commands intended for direct execution.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The setup instructs the agent to automatically read and later write user-scoped files under ~/Clawic to load and persist preferences and memory, without any user notice or consent mechanism. Even if intended for convenience, this creates a privacy and persistence risk because the agent may access or store personal context outside the immediate task scope.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The documentation instructs users to run npx sv add tailwindcss without pinning an explicit package version. Because npx resolves and executes the latest matching package from the registry at runtime, a compromised upstream release, dependency hijack, or unexpected breaking change could cause arbitrary code execution on the developer machine or non-reproducible setup behavior.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

The documentation instructs users to run npx sv without pinning a version, which allows execution of whatever package version is current at install time. In CI, onboarding, or automated agent workflows, this can introduce supply-chain risk, reduce reproducibility, and expose users to a compromised or breaking upstream release.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
81% confidence
Finding

Using npx svelte-check without a pinned version causes CI and local runs to fetch or resolve a potentially newer tool version at execution time. That creates a supply-chain and reproducibility problem: a malicious or simply incompatible release could alter results, fail builds unexpectedly, or execute unreviewed code.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
81% confidence
Finding

The command npx vitest run --coverage relies on an unpinned package version, which is unsafe in security-sensitive or automated contexts because the resolved version can drift over time. If the upstream package or one of its distribution paths is compromised, users may execute attacker-controlled code during testing.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
82% confidence
Finding

Referencing npx playwright test without pinning a version permits floating dependency resolution for a tool that runs extensive automation code and browser binaries. In CI or agent-driven use, this increases both supply-chain exposure and non-reproducible behavior if a new or compromised version is fetched.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The snippet is presented as a valid example of server-load streaming behavior, but export const load = ({ params }) => ({ post: await ... }) is not valid JavaScript because await cannot be used in a non-async function. This is an intent/documentation mismatch: the example claims to demonstrate correct streaming structure while showing code that would not run as written.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.