OWASP-Oriented Security for Vue and Nuxt Single-Page Apps
Practical OWASP-aligned practices for securing Vue and Nuxt apps—XSS, auth, CSP, and third-party risk without security theater.
SPAs shift risk to the browser and to API boundaries. Cross-site scripting still tops the list: never trust HTML from users or third parties without sanitization, and prefer framework defaults for binding over raw `v-html`. Content Security Policy is not optional for production—tighten it iteratively and monitor violations in staging before you block legitimate traffic.
Authentication needs clear rules. Store tokens with httpOnly cookies when possible, rotate refresh tokens, and avoid localStorage for high-value secrets. For Nuxt, align server middleware and API routes so authorization is enforced server-side—client-side guards improve UX but never replace real checks.
Third-party scripts and analytics are supply-chain risk: subresource integrity where applicable, least privilege on API keys in the client, and regular dependency audits. Threat modeling does not need a slide deck—start with data flows from user input to persistence, and test the edges with burp suites or OWASP ASVS-style checklists tailored to your app.