Nuxt fullstack security review

From VincentChuWaiChow/vanguard-frontier-agentic · View interactive version

Nuxt fullstack security review is an AI agent skill from the GitHub repository VincentChuWaiChow/vanguard-frontier-agentic. Statically review Nuxt 3/4 full-stack code for private secrets exposed via runtimeConfig.public/NUXT_PUBLIC_* env vars, useState/module-scope cross-request state pollution in Nitro, server-route SSRF via $fetch/ofetch with blind useRequestHeaders/credential forwarding, NuxtPayload/useState serializa

How to use this skill

Skill file

Nuxt Fullstack Security Review

Purpose

Review Nuxt 3/4 full-stack code — nuxt.config.ts, composables/, plugins/,

server/api/, server/routes/, server/middleware/, and templates using

useState/v-html — for five defect classes Nuxt's own documentation and its

long-lived Nitro server model make security-critical: (a) private secrets placed

under runtimeConfig.public (or fed by NUXT_PUBLIC_* env vars) so they ship in the

client bundle, (b) useState/module-scope reactive or mutable state leaking across

requests in Nitro's single long-lived process, (c) server-route SSRF via

$fetch/ofetch to a user-controlled URL and blind forwarding of

useRequestHeaders()/credentials, (d) NuxtPayload/useState data reaching an

unsanitized render sink (XSS), and (e) missing security response headers

(routeRules headers, the nuxt-security module, useResponseHeader). This

skill exists so the review stays anchored to these five documented, structural

defect classes instead of drifting into a general "Nuxt code review."

When to use

Use this skill when the user asks to:

secret-exposure or missing-header risk,

service ($fetch/ofetch/event.$fetch),

classic cross-request state pollution symptom,

Do not use this skill for:

reactivity-boundary design with no security angle — use

vue-composition-api-architecture-review instead,

usage) with no Nuxt-specific API involved — use vue-ssr-security-review instead,

Nuxt-specific runtimeConfig/server//useState surface — use

vue-state-store-security-review or vue-router-navigation-security-review

instead,

captured cross-user response, an actual SSRF probe against a running deployment) to

confirm exploitation — static analysis proves the structural risk, not that it has

already been exploited in production.

Context7 Documentation Protocol

/websites/nuxt_3_x (Nuxt 3 prose docs) before citing any runtimeConfig,

useState, $fetch/event.$fetch/useRequestFetch/useRequestHeaders,

payload/devalue, routeRules, or useResponseHeader behavior as fact. Both are

Nuxt's own documentation site content mirrored into Context7 — treat matches from

either as documentation-based.

before assuming version-specific defaults; the APIs this skill covers are stable

across 3/4, but state which major was confirmed when citing a claim.

configuration surface is not covered by Nuxt's own Context7-indexed docs —

never state a specific default for it as documentation-based. Confirm its

presence/config by reading the repo's nuxt.config.ts directly, and label any

claim about its behavior inference unless corroborated by the module's own

documentation (not currently in scope for this skill's Context7 grounding).

explicitly and label the claim inference.

metadata.json and label the claim `documentation-based, unverified against

current release`.

Lean operating rules

(missing-security-headers may be MEDIUM-to-HIGH depending on the app's actual

surface — see references/ssrf-payload-and-response-headers.md, Part 3). Do not

downgrade a structural runtimeConfig exposure, cross-request state leak, SSRF

path, or payload-XSS trace to informational because it has not been observed

exploited yet.

finding that says "this might leak the secret" or "this fetch call could be

SSRF" without showing the specific config key, the specific module-scope

declaration and its reachability, or the specific origin-to-sink trace is a

guess, not a finding.

under public = client-exposed) — never by variable name alone. A key named

apiSecret sitting inside public is exposed; a key named baseUrl sitting

outside public is still private and not itself a finding.

mutability/reactivity (only useState/ref/reactive/mutable objects are at

risk; immutable constants are not), and reachability from server-rendered code

(a declaration no server-rendered path ever touches is not a finding in this

scope).

from SSRF just because it "looks like an API call" — trace the destination URL

to its origin and confirm either a hardcoded host or an explicit allowlist check

before the request fires.

useRequestHeaders(...), or manual header spreading) as safe just because

Nuxt documents the mechanism — the mechanism existing is not the same as its

use being scoped to only the headers actually needed and only trusted

destinations.

named sanitizer call is visibly present on that exact traced path — a sanitizer

existing elsewhere in the codebase does not clear this bar.

exists somewhere in the config — confirm the routeRules glob (or module

config) actually covers the routes in scope before crediting it.

part of this review; this is a static-review skill (Read/Grep/Glob only).

References

Load these only when needed:

for the step-by-step review procedure, the full decision tree across all five

defect classes, and the required output shape.

— load when reviewing nuxt.config.ts's runtimeConfig block, NUXT_PUBLIC_*

env vars, or useState/module-scope reactive/mutable declarations reachable

from server-rendered code.

— load when reviewing a server/api/server/routes handler's outbound

$fetch/ofetch/event.$fetch/useRequestFetch calls, a useState/payload

value that renders somewhere, or routeRules/security-module configuration.

defects this skill must catch and the false positives it must not raise; consult

when unsure whether a pattern is in scope.

Response minimum

Return, at minimum:

routes, and/or template bindings in scope,

(runtimeconfig-exposure / cross-request-state-pollution / ssrf /

credential-forwarding / payload-xss / missing-security-headers), the

concrete data-flow trace, and a fix sketch matching Nuxt's documented pattern,

whether a sanitizer call is present on the traced path — never approve on the

assumption one exists elsewhere,

inference), with structural risk findings explicitly labeled as structural

risk, not as confirmed-exploited,

cross-request leakage requires concurrent-request load testing, not static

review").

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.