Gitpedia

Nuxt security

πŸ›‘ Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware

From BaroshemΒ·Updated May 20, 2026Β·View on GitHubΒ·

[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![Github Actions CI][github-actions-ci-src]][github-actions-ci-href] [![License][license-src]][license-href] [![Nuxt][nuxt-src]][nuxt-href] The project is written primarily in TypeScript, distributed under the MIT License license, first published in 2022. Key topics include: basic-authentication, cors, csrf, headers-security, module.

Latest release: v2.6.0β€” 2.6.0

nuxt-security

npm version
npm downloads
Github Actions CI
License
Nuxt

Nuxt Security

Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware.

This module works with Nuxt 3.X and newer (4.X)

Features

  • Security response headers (including CSP for SSG apps)
  • Request Size & Rate Limiters
  • Cross Site Scripting (XSS) Validation
  • Cross-Origin Resource Sharing (CORS) support
  • Hide X-Powered-By header and remove console loggers utils
  • [Optional] Allowed HTTP Methods, Basic Auth, CSRF

Usage

Install the module:

sh
npx nuxi@latest module add security

And that's it! The module will now register route rules and server middlewares globally so that your application will be more secured.

Configuration

You can pass configuration to the module in the nuxt.config.ts like following:

ts
export default defineNuxtConfig({ modules: ["nuxt-security"], security: { // options } })

For all available configuration options check out the docs.

Development

  • Run yarn dev:prepare to generate type stubs.
  • Use yarn dev to start playground in development mode.

License

MIT License

<!-- Badges -->

Contributors

Showing top 12 contributors by commit count.

View all contributors on GitHub β†’

This article is auto-generated from Baroshem/nuxt-security via the GitHub API.Last fetched: 5/31/2026