diff --git a/nuxt.config.ts b/nuxt.config.ts index a59a409885..3a52084766 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,6 +1,6 @@ import process from 'node:process' import { currentLocales } from './config/i18n' -import { isCI, isTest, provider } from 'std-env' +import { isCI, isDevelopment, isWindows, isTest, provider } from 'std-env' export default defineNuxtConfig({ modules: [ @@ -15,6 +15,7 @@ export default defineNuxtConfig({ '@vueuse/nuxt', '@nuxtjs/i18n', '@nuxtjs/color-mode', + ...(isDevelopment || isWindows ? [] : ['nuxt-security']), ], $test: { diff --git a/package.json b/package.json index e9c375c7ba..2aa86371d4 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "module-replacements": "2.11.0", "nuxt": "4.3.1", "nuxt-og-image": "5.1.13", + "nuxt-security": "2.5.1", "ofetch": "1.5.1", "ohash": "2.0.11", "perfect-debounce": "2.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d560fe3014..b407c69e57 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -143,6 +143,9 @@ importers: nuxt-og-image: specifier: 5.1.13 version: 5.1.13(@unhead/vue@2.1.3(vue@3.5.29(typescript@5.9.3)))(magicast@0.5.1)(unstorage@1.17.4(@upstash/redis@1.36.2)(@vercel/kv@3.0.0)(db0@0.3.4(better-sqlite3@12.6.2))(ioredis@5.9.2))(vite@7.3.1(@types/node@24.10.13)(jiti@2.6.1)(lightningcss@1.31.1)(terser@5.46.0)(yaml@2.8.2))(vue@3.5.29(typescript@5.9.3)) + nuxt-security: + specifier: 2.5.1 + version: 2.5.1(magicast@0.5.1)(rollup@4.59.0) ofetch: specifier: 1.5.1 version: 1.5.1 @@ -5222,6 +5225,10 @@ packages: resolution: {integrity: sha512-e23vBV1ZLfjb9apvfPk4rHVu2ry6RIr2Wfs+O324okSidrX7pTAnEJPCh/O5BtRlr7QtZI7ktOP3vsqr7Z5XoA==} hasBin: true + basic-auth@2.0.1: + resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} + engines: {node: '>= 0.8'} + better-sqlite3@12.6.2: resolution: {integrity: sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA==} engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x} @@ -7788,6 +7795,9 @@ packages: resolution: {integrity: sha512-5pVCzWXqg9HP159JDhdfQJtFvgmS/KouEVpyYLPEBXWMrQoJBwujsczmLeIKXKI2BTy4RqfXy8N1GfGTZNb57g==} hasBin: true + nuxt-csurf@1.6.5: + resolution: {integrity: sha512-/DMNTON8LIVhntamKbBmAuM879B0QnuSJa7ZAkmkZe+21m+1QGcjVUxtSkizaM48NUvkuAGYOG0ncn+kqEgrzw==} + nuxt-define@1.0.0: resolution: {integrity: sha512-CYZ2WjU+KCyCDVzjYUM4eEpMF0rkPmkpiFrybTqqQCRpUbPt2h3snswWIpFPXTi+osRCY6Og0W/XLAQgDL4FfQ==} @@ -7801,6 +7811,10 @@ packages: '@unhead/vue': ^2.0.5 unstorage: ^1.15.0 + nuxt-security@2.5.1: + resolution: {integrity: sha512-gXUhJiOqgkKkP0FHDAPOuREjoala0p6G/4TIlkti1ZafpJV8TkjjFqCNT6NuiWHxKzVYY00OIR1tbRcZuJ7LmQ==} + engines: {node: '>=20.0.0'} + nuxt-site-config-kit@3.2.18: resolution: {integrity: sha512-Emk/0LKIrojvdidrZep8bS4BGvP4iTxtlUaoEEtEMJbBsNV0nDHrNRpEEeJoAywfMgnKpUorNBT6MkDM7Yt0KA==} @@ -9380,6 +9394,9 @@ packages: uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + uncsrf@1.2.0: + resolution: {integrity: sha512-EyeG1tIx1zisLuqokSXZ5LhndzaUd2WBMS+18IlBUYobJsKSUQMpLIEm6QUfY/Azmhnnz0v2QbkrT6/u2K/Y1g==} + unctx@2.5.0: resolution: {integrity: sha512-p+Rz9x0R7X+CYDkT+Xg8/GhpcShTlU8n+cf9OtOEf7zEQsNcCZO1dPKNRDqvUTaq+P32PMMkxWHwfrxkqfqAYg==} @@ -9503,6 +9520,9 @@ packages: '@vueuse/core': optional: true + unplugin-remove@1.0.3: + resolution: {integrity: sha512-BZMt9v8Y/Z27cY7YQv+DpcW928znjP1cqplBXOirbANiFQtM2YCdiyNAJhHCvjppT0lScNn1aDrQnXqnRp32pQ==} + unplugin-utils@0.2.5: resolution: {integrity: sha512-gwXJnPRewT4rT7sBi/IvxKTjsms7jX7QIDLOClApuZwR49SXbrB1z2NLUZ+vDHyqCj/n58OzRRqaW+B8OZi8vg==} engines: {node: '>=18.12.0'} @@ -9541,6 +9561,10 @@ packages: vue-router: optional: true + unplugin@1.16.1: + resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==} + engines: {node: '>=14.0.0'} + unplugin@2.3.11: resolution: {integrity: sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==} engines: {node: '>=18.12.0'} @@ -15364,6 +15388,10 @@ snapshots: baseline-browser-mapping@2.9.18: {} + basic-auth@2.0.1: + dependencies: + safe-buffer: 5.1.2 + better-sqlite3@12.6.2: dependencies: bindings: 1.5.0 @@ -15725,8 +15753,7 @@ snapshots: cssesc@3.0.0: {} - cssfilter@0.0.10: - optional: true + cssfilter@0.0.10: {} cssnano-preset-default@7.0.10(postcss@8.5.6): dependencies: @@ -18522,6 +18549,14 @@ snapshots: transitivePeerDependencies: - magicast + nuxt-csurf@1.6.5(magicast@0.5.1): + dependencies: + '@nuxt/kit': 3.21.0(magicast@0.5.1) + defu: 6.1.4 + uncsrf: 1.2.0 + transitivePeerDependencies: + - magicast + nuxt-define@1.0.0: {} nuxt-llms@0.2.0(magicast@0.5.1): @@ -18570,6 +18605,20 @@ snapshots: - vite - vue + nuxt-security@2.5.1(magicast@0.5.1)(rollup@4.59.0): + dependencies: + '@nuxt/kit': 4.3.1(magicast@0.5.1) + basic-auth: 2.0.1 + defu: 6.1.4 + nuxt-csurf: 1.6.5(magicast@0.5.1) + pathe: 2.0.3 + unplugin-remove: 1.0.3(rollup@4.59.0) + xss: 1.0.15 + transitivePeerDependencies: + - magicast + - rollup + - supports-color + nuxt-site-config-kit@3.2.18(magicast@0.5.1)(vue@3.5.29(typescript@5.9.3)): dependencies: '@nuxt/kit': 4.3.1(magicast@0.5.1) @@ -20701,6 +20750,8 @@ snapshots: uncrypto@0.1.3: {} + uncsrf@1.2.0: {} + unctx@2.5.0: dependencies: acorn: 8.16.0 @@ -20868,6 +20919,19 @@ snapshots: '@nuxt/kit': 4.3.1(magicast@0.5.1) '@vueuse/core': 14.2.1(vue@3.5.29(typescript@5.9.3)) + unplugin-remove@1.0.3(rollup@4.59.0): + dependencies: + '@babel/core': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/parser': 7.29.0 + '@babel/traverse': 7.29.0 + '@rollup/pluginutils': 5.3.0(rollup@4.59.0) + magic-string: 0.30.21 + unplugin: 1.16.1 + transitivePeerDependencies: + - rollup + - supports-color + unplugin-utils@0.2.5: dependencies: pathe: 2.0.3 @@ -20943,6 +21007,11 @@ snapshots: transitivePeerDependencies: - vue + unplugin@1.16.1: + dependencies: + acorn: 8.16.0 + webpack-virtual-modules: 0.6.2 + unplugin@2.3.11: dependencies: '@jridgewell/remapping': 2.3.5 @@ -21553,7 +21622,6 @@ snapshots: dependencies: commander: 2.20.3 cssfilter: 0.0.10 - optional: true y-protocols@1.0.7(yjs@13.6.29): dependencies: