Skip to content
Report library
Purpose / Other

Vue Router Best Practices Skill Security Audit

What the author says it does (original text)

Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.

Independent security check

Do not install or run it yet

Files checked
11
Risks found
1
Could it run dangerous commands?Looks for programs run straight after downloading, remote control of your computer, and hidden commands.No risks found
Could it expose your files or keys?Looks for uploads of files containing passwords or keys, and keys written directly in the code.No risks found
Could it delete files or keep running?Looks for broad file deletion, disk overwrites, and programs set to start automatically.No risks found
Could it bypass safety checks?Looks for skipped website security checks, excessive file access, or actions that skip your approval.Risks found: 1
High risk

Protected-route examples fail open on authentication timeout or network error

Source references: 3
What we found

The guide labels its timeout pattern “CORRECT,” but an authentication timeout only produces a warning and no denial or redirect. A separate error-handling example explicitly returns true for NETWORK_ERROR; in Vue Router, true permits navigation.

Why this matters

If these patterns are used on requiresAuth routes, a network failure or induced timeout bypasses the client-side authentication gate. Restricted UI or data could become accessible if the page or backend also incorrectly relies on that gate.

The candidate is supported by the source, though these are teaching examples rather than self-executing code. The guide labels the timeout pattern “CORRECT,” but on an authentication timeout it only logs a warning and returns no denial, so the guard proceeds by default. Another example explicitly returns true for a network error. If copied into a protected route, an authentication-service outage could allow client-side navigation. Client router guards also must not replace server-side authorization. Users can ask the author to fail closed on auth errors, timeouts, and network failures and to state that the server must independently enforce access.

reference/router-guard-async-await-pattern.md:141In the instructionsOpen original file
router.beforeEach(async (to, from) => {  if (to.meta.requiresAuth) {    try {      const isValid = await withTimeout(checkAuth(), 5000)      if (!isValid) {        return '/login'      }    } catch (error) {      if (error.message === 'Request timeout') {        // Let user through but show warning        console.warn('Auth check timed out')      } else {        return '/login'      }    }  }})```
Show 2 other places
reference/router-guard-async-await-pattern.md:204In the instructionsOpen original file
    if (error.code === 'NETWORK_ERROR') {      // Offline - maybe allow navigation but show warning      return true    }
reference/router-guard-async-await-pattern.md:218In the instructionsOpen original file
1. **Always await async operations** - Otherwise navigation proceeds immediately2. **Return values matter** - Return route to redirect, false to cancel, true/undefined to proceed3. **Handle all error cases** - Uncaught errors can hang navigation4. **Add timeouts** - Slow APIs shouldn't block navigation indefinitely5. **Show loading state** - Users need feedback during async checks
Could it mislead the AI or hide text?Checks the skill instructions for requests to ignore you, influence the report, or hide text in invisible characters.No risks found
Could it change links or payment recipients without asking?Looks for forced referral or payment changes combined with instructions to hide the change.No risks found

Inside this skill

3 instruction sections

This Skill is a documentation-only Vue Router guide. Its entry file routes navigation-guard, route-lifecycle, and production-setup questions to eight reference documents. The supplied source contains no install command or executable script.

View source
SKILL.md:9In the instructionsOpen original file
Vue Router best practices, common gotchas, and navigation patterns.### Navigation Guards- Navigating between same route with different params → See [router-beforeenter-no-param-trigger](reference/router-beforeenter-no-param-trigger.md)- Accessing component instance in beforeRouteEnter guard → See [router-beforerouteenter-no-this](reference/router-beforerouteenter-no-this.md)- Navigation guard making API calls without awaiting → See [router-guard-async-await-pattern](reference/router-guard-async-await-pattern.md)- Users trapped in infinite redirect loops → See [router-navigation-guard-infinite-loop](reference/router-navigation-guard-infinite-loop.md)- Navigation guard using deprecated next() function → See [router-navigation-guard-next-deprecated](reference/router-navigation-guard-next-deprecated.md)
SKILL.md:18In the instructionsOpen original file
### Route Lifecycle- Stale data when navigating between same route → See [router-param-change-no-lifecycle](reference/router-param-change-no-lifecycle.md)- Event listeners persisting after component unmounts → See [router-simple-routing-cleanup](reference/router-simple-routing-cleanup.md)### Setup- Building production single-page application → See [router-use-vue-router-for-production](reference/router-use-vue-router-for-production.md)

The guide recommends global or in-component guards for checking access to an order selected by a route parameter, and warns that same-route parameter changes do not trigger beforeEnter.

View source
reference/router-beforeenter-no-param-trigger.md:40In the instructionsOpen original file
**Scenario:**1. User navigates from `/products` to `/orders/1` - beforeEnter runs, access checked2. User navigates from `/orders/1` to `/orders/2` - beforeEnter DOES NOT run!3. User might access order they don't have permission for!
reference/router-beforeenter-no-param-trigger.md:78In the instructionsOpen original file
// router.jsrouter.beforeEach(async (to, from) => {  // Handle all order access checks globally  if (to.name === 'OrderDetail') {    // This runs on EVERY navigation to this route, including param changes    const order = await checkOrderAccess(to.params.id)    if (!order.canView) {      return '/unauthorized'    }  }})```

The guide explains that navigating between parameter values on the same route reuses the component and can leave data from the previous parameter visible; it recommends watching the parameter or using onBeforeRouteUpdate.

View source
reference/router-param-change-no-lifecycle.md:46In the instructionsOpen original file
**Scenario:**1. Visit `/users/1` - Component mounts, fetches User 1 data2. Navigate to `/users/2` - Component is REUSED, onMounted doesn't run3. UI still shows User 1's data!
reference/router-param-change-no-lifecycle.md:62In the instructionsOpen original file
// Watch for param changes - handles both initial load and navigationwatch(  () => route.params.id,  async (newId) => {    loading.value = true    user.value = await fetchUser(newId)    loading.value = false  },  { immediate: true }  // Run immediately for initial load)</script>
Start here · InstructionsSKILL.md
vue-router-best-practices
Lines connect the instruction file to its sections, not an observed execution order. Select a section to read the source.

File reference map

References: 8
Files making referencesReferenced content
Lines show actual file references, not execution order. Select a node to highlight its connections and inspect the files and source locations. Dashed lines include files that still need locating.
Files and check records11 files

Coverage and gaps

Content covered in each file

These are the source ranges included in this check, not a guarantee that every issue has been resolved.

  • SKILL.mdFull text included
  • reference/router-beforeenter-no-param-trigger.mdFull text included
  • reference/router-beforerouteenter-no-this.mdFull text included
  • reference/router-guard-async-await-pattern.mdFull text included
  • reference/router-navigation-guard-infinite-loop.mdFull text included
  • reference/router-navigation-guard-next-deprecated.mdFull text included
  • reference/router-param-change-no-lifecycle.mdFull text included
  • reference/router-simple-routing-cleanup.mdFull text included
  • reference/router-use-vue-router-for-production.mdFull text included
  • LICENSE.mdFull text included
  • SYNC.mdFull text included

This report is for the version above. We read the available code and instructions without running the skill or checking extra packages it installs. This is not a promise of safety: a different version or setup may behave differently.

  • LICENSE.mdLicense
  • SKILL.mdInstructions
  • SYNC.mdSupporting file
  • reference/router-beforeenter-no-param-trigger.mdSupporting file
  • reference/router-beforerouteenter-no-this.mdSupporting file
  • reference/router-guard-async-await-pattern.mdSupporting file
  • reference/router-navigation-guard-infinite-loop.mdSupporting file
  • reference/router-navigation-guard-next-deprecated.mdSupporting file
  • reference/router-param-change-no-lifecycle.mdSupporting file
  • reference/router-simple-routing-cleanup.mdSupporting file
  • reference/router-use-vue-router-for-production.mdSupporting file

Operations mentioned in code and instructions

Connect to websites
reference/router-beforeenter-no-param-trigger.md:166In the instructionsOpen original file
## Reference- [Vue Router Navigation Guards](https://router.vuejs.org/guide/advanced/navigation-guards.html)- [Vue Router Per-Route Guards](https://router.vuejs.org/guide/advanced/navigation-guards.html#per-route-guard)
reference/router-beforeenter-no-param-trigger.md:167In the instructionsOpen original file
- [Vue Router Navigation Guards](https://router.vuejs.org/guide/advanced/navigation-guards.html)- [Vue Router Per-Route Guards](https://router.vuejs.org/guide/advanced/navigation-guards.html#per-route-guard)
reference/router-beforerouteenter-no-this.md:175In the instructionsOpen original file
## Reference- [Vue Router In-Component Guards](https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards)- [Vue Router Navigation Resolution Flow](https://router.vuejs.org/guide/advanced/navigation-guards.html#the-full-navigation-resolution-flow)
Lines read
1,540
File checksum (to compare versions)
bc1db2bada3594b954b6233065f1d7684683726ac5727f4534f79dcfe70e3df5