$ show Baroshem/nuxt-security
Nuxt Security is a Nuxt 3+ module that automatically configures applications to follow OWASP security patterns through HTTP headers and middleware. It provides security response headers (including CSP with nonce/hash support for SSR/SSG), request size and rate limiting, XSS validation, CORS support, and optional features like Basic Auth and CSRF protection. The architecture uses Nitro plugins to integrate with Nuxt's server lifecycle, separating concerns between configuration, middleware, build-time plugins, and runtime hooks. The module handles both SSR and SSG modes appropriately, using nonces for CSP in SSR and computed hashes for SSG, with proper strict-dynamic support.
The LLM identified 2 files worth highlighting for reuse:
Contains self-contained cryptographic utilities for generating hashes (SHA-256/384/512) and random nonces using the Web Crypto API. These functions are framework-agnostic and could be easily extracted to any JavaScript/TypeScript project needing secure random generation or content hashing.
Provides conversion utilities between header objects and strings for various security headers (CSP, Permissions Policy, HSTS, etc.). Handles complex formatting requirements of different header specifications and could be reused in other projects needing HTTP header manipulation.