Baroshem / nuxt-security

🛡 Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware
https://nuxt-security.vercel.app/
MIT License
820 stars 56 forks source link

Can't use escapeHtml #499

Open jeky1950 opened 3 months ago

jeky1950 commented 3 months ago

Nuxt Version: 3.11.2 Nuxt Security Version: 2.0.0-rc.9

Its entirely possible that it could be my fault, please correct me if so. I wanted to convert all < to < and > to > in my request body, so I added this to my nuxt.config.ts

xssValidator: { escapeHtml: true },

but I keep getting this error

ERROR [nuxt] [request error] [unhandled] [500] escapeHtml is not a function at parseTag (C:\Users\User\Documents\project\node_modules\xss\lib\parser.js:110:16) at FilterXSS.process (C:\Users\User\Documents\project\node_modules\xss\lib\xss.js:162:17) at Object.handler (C:\Users\User\Documents\project\node_modules\nuxt-security\dist\runtime\server\middleware\xssValidator.mjs:15:47) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /C:/Users/User\Documents\project/node_modules/h3/dist/index.mjs:1962:19 at async Object.callAsync (/C:/Users/User\Documents\project/node_modules/unctx/dist/index.mjs:72:16) at async Server.toNodeHandle (/C:/Users/User\Documents\project/node_modules/h3/dist/index.mjs:2249:7)

Baroshem commented 3 months ago

Hey there, sorry but I missed this issue completely, could you create a reproduction link with this issue? I cannot reproduce it :(