Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@jamesnimlos/express-caja-sanitizer
Advanced tools
Readme
An express middleware inspired from express-sanitizer but additionally sanitizes URL params. It also gives an option to provide a preprocessor function to decide whether a (key, value) pair should be sanitized or not.
npm install express-caja-sanitizer
Needs to be called after express.bodyParser() and before anything that requires the sanitized input, e.g.:
var express = require('express');
var bodyParser = require('body-parser');
var cajaSanitizer = require('express-caja-sanitizer');
var app = express();
app.use(bodyParser());
app.use(cajaSanitizer());
This module by default sanitizes the request URL params (req.params
), apart from request body and query string params, e.g.:
http://www.myapp.com/rest/user/<script>console.log("hello")</script>bob/details
will be sanitized as
http://www.myapp.com/rest/user/bob/details
shouldSanitize
When shouldSanitize
function is provided as an option, the module will sanitize only the (key, value) pairs for which the function returns true
.
For example, if we don't want to sanitize XML values then the preprocesser function can be
var shouldSanitize = function(key, value) {
return !value.startsWith('<?xml version="1.0"')
}
##Limitations This is a basic implementation of Caja-HTML-Sanitizer with the specific purpose of mitigating against persistent XSS risks.
##Caveats This module trusts the dependencies to provide basic persistent XSS risk mitigation. A user of this package should review all packages and make their own decision on security and fitness for purpose.
FAQs
An express middleware inspired from express-sanitizer but additionally sanitizes URL params. It also gives an option to provide a preprocessor function to decide whether a (key, value) pair should be sanitized or not.
The npm package @jamesnimlos/express-caja-sanitizer receives a total of 1 weekly downloads. As such, @jamesnimlos/express-caja-sanitizer popularity was classified as not popular.
We found that @jamesnimlos/express-caja-sanitizer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.