
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
express-defend
Advanced tools
Express middleware that detects malicious requests, like XSS or Path Traversal

NodeJS Express middleware that detects malicious requests on your site (originated from automated website vulnerability scanner, or an attacker) like:
http://<your website>/page.html?name=<script>alert('hello world')</script>
http://<your website>/page.html?path=../../etc/passwd
Once a possible security threat is detected by express-defend, you can block all other requests sent from the attacker. If file logging is enabled, you can check the logfile and see how attackers try to find a security vulnerabilties on your server (it makes sense to see it, there might be real issues as well).
Current implementation supports the followings:
Please note that this module will never be able to detect security threats with 100% precision. The goal of this project is to catch and report the very first 'obvious' attempts, if possible.
$ npm install express-defend
Setting up your express server with express-defend support
var expressDefend = require('express-defend');
app.use(expressDefend.protect({
maxAttempts: 5, // (default: 5) number of attempts until "onMaxAttemptsReached" gets triggered
dropSuspiciousRequest: true, // respond 403 Forbidden when max attempts count is reached
consoleLogging: true, // (default: true) enable console logging
logFile: 'suspicious.log', // if specified, express-defend will log it's output here
onMaxAttemptsReached: function(ipAddress, url){
console.log('IP address ' + ipAddress + ' is considered to be malicious, URL: ' + url);
}
}));
Above example in action

Please note that only suspicious traffic will be dropped from a malicious host when "dropSuspiciousRequest" is enabled. If you want to put the host on blacklist on your server, you might want to use this module with express-blacklist.
FAQs
Express middleware that detects malicious requests, like XSS or Path Traversal
We found that express-defend 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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.