Socket
Socket
Sign inDemoInstall

@nemospeculo/express-sanitized

Package Overview
Dependencies
2
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nemospeculo/express-sanitized

Express middleware for the sanitizer module using Caja's HTML Sanitizer.


Version published
Weekly downloads
5
increased by400%
Maintainers
3
Install size
971 kB
Created
Weekly downloads
 

Readme

Source

express-sanitized

npm version dependencies devDependencies peerDependencies Known Vulnerabilities

Installation

npm install express-sanitized

Usage

Place this directly after express.bodyParser() and before any express middleware that accesses query or body parameters, e.g.:

var express = require('express'),
    expressSanitized = require('express-sanitized');

app.use(express.bodyParser());
app.use(expressSanitized()); // this line follows express.bodyParser()

Output

The string

'<script>document.write('cookie monster')</script> download now'

will be sanitized to ' download now'.

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.

This module was inspired by express-sanitizer. The difference here is strict laziness. This middleware automatically sanitizes post and query values whereas that module requires you to manually sanitize each parameter.

Changelog

v1.0.0

  • Updated packages

v0.6.0

  • Update packages

v0.5.1

  • Initial release

Contributors

License

Copyright (c) 2014 Patrick Hogan patrick@callinize.com, MIT License

Keywords

FAQs

Last updated on 07 May 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc