Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
express-auto-sanitize
Advanced tools
Readme
npm i --save express-auto-sanitize
Import the module with this declaration at the top of the file:
const sanitizer = require('express-auto-sanitize')
Mount the middleware
const options = {
query: Boolean,
body: Boolean,
cookies: Boolean,
original: Boolean, // will keep the original version in req.original
sanitizerFunction: Function // use your personnal sanitizing algorithm
}
app.use(sanitizer(options))
Note: if you use the body option, make sure you mount the sanitizer between the body-parser/cookie-parser middleware and your routes declaration.
After the middleware has processed the input, the original version will be stored in req.original
and the safe version will replace the dangerous input.
app.get('/', (req, res) => {
console.log(req.query.exampleParam) // safe and sanitized
console.log(req.original.query.exampleParam) // potentially dangerous
})
express-auto-sanitize is MIT licensed.
FAQs
Express middleware that automatically sanitize user inputs
The npm package express-auto-sanitize receives a total of 53 weekly downloads. As such, express-auto-sanitize popularity was classified as not popular.
We found that express-auto-sanitize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.