
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
Canonical URL:
https://alexstevovich.com/a/botpolice-nodejs
Software URL:
https://midnightcitylights.com/software/botpolice-nodejs
botpolice is a simple utility for detecting automated or crawler requests based on the User-Agent heuristics. It checks if the User-Agent string matches common bot names like "bot", "spider", "crawler", and others.
npm install botpolice
import express from 'express';
import botpolice from 'botpolice';
const app = express();
// Use botpolice to block requests from bots
app.use((req, res, next) => {
if (botpolice(req)) {
res.status(403).send('Bot detected!');
} else {
next();
}
});
app.get('/', (req, res) => {
res.send('Hello, world!');
});
app.listen(3000, () => {
console.log('Server running on http://localhost:3000');
});
botpolice(req)req: The request object.true if the request is from a bot, false otherwise.The function checks the User-Agent header in the request and matches it against common bot patterns (e.g., "bot", "spider", "crawler", etc.).
Licensed under the MIT License.
FAQs
Detects automated or crawler requests based on User-Agent heuristics.
We found that botpolice demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.