Preventing XSS in Node.js / server side javascript

后端 未结 8 2012
花落未央
花落未央 2020-12-07 10:24

Any idea how one would go about preventing XSS attacks on a node.js app? Any libs out there that handle removing javascript in hrefs, onclick attributes,etc. from POSTed dat

8条回答
  •  一个人的身影
    2020-12-07 11:15

    I've created a module that bundles the Caja HTML Sanitizer

    npm install sanitizer
    

    http://github.com/theSmaw/Caja-HTML-Sanitizer

    https://www.npmjs.com/package/sanitizer

    Any feedback appreciated.

提交回复
热议问题