Back to skill

Security audit

vue-specialist

Security checks for vulnerabilities and agentic risk

Overview

This Vue helper skill is a markdown-only coding reference; the main caveat is one auth example that could encourage unsafe browser storage if copied directly.

This skill is reasonable to install as Vue coding guidance. Before copying its auth examples into production, avoid storing full user objects, tokens, or session material in localStorage; prefer server-managed HttpOnly cookies or an explicit allowlist of non-sensitive UI fields.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
references/examples.md:259
Finding

Sensitive Authentication State Persisted in Browser Local Storage

Content
View full analysis

Vulnerability Details

File Location: references/examples.md, lines 259–260 and 292–298
Vulnerability Type: Client-side storage of potentially sensitive authentication data
Risk Level: Medium

Vulnerable Code

typescript
// Persist to localStorage
localStorage.setItem('user', JSON.stringify(user))
typescript
persist: {
  enabled: true,
  strategies: [
    {
      key: 'user',
      storage: localStorage,
      paths: ['currentUser']
    }
  ]
}

Technical Analysis

The example stores the complete user object returned by the login API in localStorage. It also configures Pinia to persist currentUser to the same script-readable storage. This creates redundant persistence and does not restrict the stored object to an explicit set of non-sensitive fields.

Data in localStorage is accessible to all JavaScript executing under the same origin. If the login response includes session tokens, authorization attributes, personal information, or other sensitive values, a cross-site scripting vulnerability or compromised same-origin dependency could retrieve them. Unlike an HttpOnly cookie, localStorage provides no mechanism that prevents JavaScript from reading stored session material.

Attack Path

  1. An application developer adopts the documented Pinia login pattern.
  2. The application receives a user object from api.login(credentials).
  3. The full response is serialized into localStorage; Pinia persistence also stores currentUser.
  4. An attacker obtains same-origin JavaScript execution through an XSS vulnerability or compromised frontend dependency.
  5. The malicious script reads the persisted user data from localStorage.
  6. If the object contains session credentials, tokens, or sensitive profile data, the attacker exfiltrates and abuses that information.

Exploitation depends on same-origin script execution and on sensitive information being present ...[truncated 544 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not persist the complete login response or authentication tokens in localStorage.
  • Store session identifiers in server-managed cookies configured with HttpOnly, Secure, and an appropriate SameSite policy.
  • Keep only the minimum non-sensitive UI state in browser storage.
  • Define an explicit allowlist of persistable fields rather than serializing the full User object.
  • Remove the duplicate explicit localStorage.setItem operation if a persistence plugin remains necessary.
  • Ensure logout invalidates the server-side session in addition to clearing client state.
  • Apply a restrictive Content Security Policy, contextual output encoding, dependency controls, and other XSS defenses to reduce exposure to same-origin malicious scripts.
  • Review existing stored records and rotate session material if tokens were previously persisted.
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

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 · references/examples.md (reported line 320)May include surrounding context.

Example 4

vue
<!-- pages/products/[id].vue -->
<template>
  <div>
    <ProductDetail :product="product" />

Static analysis

No suspicious patterns detected.