
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
xss-advanced
Advanced tools
Node.js Connect middleware to sanitize user input coming from POST body, GET queries, and url params. Works with Express
Node.js Connect middleware to sanitize user input coming from POST body, GET queries, and url params. Works with Express.
About middleware:
Content:
npm install xss-advanced@latest
Important note: You must use express.json() or body-parser middleware (in order to parse req.body) before adding xss-clean-advanced middleware
const xssAdvanced = require('xss-advanced')
const app = express();
<!-- First you add body parser middleware -->
app.use(express.json());
<!-- Then you add the middleware itself -->
app.use(xssAdvanced());
Since this middleware is built on top of xss, as a argument it acceps any options available by the xss library.
Argument | Default value | Available value |
---|---|---|
xssOptions | { css: false, stripIgnoreTagBody: ['script'] } | CHECK ALL AVAILABLE OPTIONS HERE |
Explanation | For default options: anywhere in the body, params or query, if there's <script> tag it will be REMOVED, however if element has css style property it will be PERSISTED | |
Examples | <script>test</script>test2 ---> test2; | |
<a href="test">da</a> ---> <a href>da</a> |
<!-- Example with using custom option, instead of default-->
const options = var options = {
whiteList: {
a: ["href", "title", "target"]
}
};
app.use(xssAdvanced(options));
If the example above returned <a href="test">da</a> ---> <a href>da</a>, this will return the full value:
THE DATA WILL BE FILTERED/XSS SANITIZED DEPENDING ON WHAT YOU PASS AS OPTIONS
By default all <script> tags are REMOVED, css styles are INCLUDED (of course you can exclude it with additional options), additional parametars like href, target, title that point to external links are also REMOVED
This examples are shown with the provided default options
FAQs
Node.js Connect middleware to sanitize user input coming from POST body, GET queries, and url params. Works with Express
The npm package xss-advanced receives a total of 0 weekly downloads. As such, xss-advanced popularity was classified as not popular.
We found that xss-advanced 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
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.