Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
node-procexss
Advanced tools
Middleware to help to prevent xss attacks in your Express/Connect apps
Middleware to help to prevent XSS attacks in your Express/Connect apps
$ npm install node-procexss
var procexss = require('node-procexss')
This middleware sanitize req.body or req.query and adds a req.dirty
flasg to identify.
pattern
String - Optional. A regex to check xss. Defaults to embedded!!
whiteList
Array[String] - Optional. List of ignored urls. Defaults to []
sanitizeBody
Boolean - Optional. If the req.body sanitize is enabled or not. Defaults to true
sanitizeQuery
Boolean - Optional. If the req.query sanitize is enabled or not. Defaults to true
mode
String -Optional. A flag to choose mode (sanitize | header)sanitize
: Works on request body or query and sanitize it if xss exist.header
: Adds X-XSS-Protection
header to response.header
Options for header
mode (enabled, mode)enabled
Boolean - Optional. If the header is enabled or not (see header docs). Defaults to 1
.mode
String - Optional. Mode to set on the header (see header docs). Defaults to block. Defaults to sanitize
The following is an example of some server-side code that shows basic setup.
var express = require('express')
var procexss = require('node-procexss')
var app = express()
app.use(function(req, res, next) {
req.query = url.parse(req.url, true).query
next()
})
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({
extended: false
}))
// parse application/json
app.use(bodyParser.json())
app.use(procexss(opts))
//Whitelist
app.use(procexss({
whiteList: ['/dashboard']
}))
//Mode `header` default settings
app.use(procexss({
mode: 'header'
}))
//Mode `header` with custom mode
app.use(procexss({
mode: 'header',
header: {
enabled: 1,
mode: 'foo'
}
}))
FAQs
Middleware to help to prevent xss attacks in your Express/Connect apps
We found that node-procexss 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.