
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Detect abnormal user behavior in the browser to identify bots or virtualized environments.
Botbuster is a lightweight JavaScript/TypeScript library designed to detect non-human behavior in browser environments. It helps determine whether a real user, a bot, or someone behind a virtual machine is interacting with your application.
This enables developers to make informed decisions about what services, permissions, or resources should be exposed — enhancing security, privacy, and resource efficiency.
import Botbuster from 'botbuster';
Botbuster.on((reason, event) => {
console.warn('Abnormal behavior detected:', reason, event);
});
npm install botbuster
yarn add botbuster
pnpm add botbuster
<script type="module">
import Botbuster from 'https://cdn.skypack.dev/botbuster';
Botbuster.then(({ start }) => start());
</script>
import Botbuster from 'botbuster';
Botbuster.on((reason, event) => {
console.warn('Abnormal behavior:', reason, event);
});
import Botbuster from 'botbuster';
Botbuster.then(() => {
console.log('Botbuster is running...');
}).catch(err => {
console.error('Botbuster failed to start:', err);
});
import Botbuster from 'botbuster';
const unsubscribe = Botbuster.listen((reason, event) => {
console.log('Anomaly detected', reason);
});
// Stop listening later if needed
unsubscribe();
Botbuster includes the following behavioral and environmental detectors:
| Detector | Description |
|---|---|
| MouseLinearityDetector | Detects mouse paths that are too straight or uniform |
| MouseJumpDetector | Detects large jumps in cursor position without events |
| MouseIntervalDetector | Detects lack of movement in expected time intervals |
| ClickEdgeDetector | Detects clicks near the edge of elements |
| ClickOutsideDetector | Detects clicks outside of visible target bounds |
| ClickDurationDetector | Detects clicks that occur too fast to be human |
| HardwareDetector | Analyzes WebGL, camera, and microphone vendor metadata |
| TabVisibilityDetector | Detects if the user leaves the browser tab or window |
Botbuster allows you to extend its capabilities by writing your own detectors. A detector is a class that implements the start() and stop() methods, and uses a shared Reporter instance to notify anomalies.
import { Detector } from 'botbuster';
import type Reporter from 'botbuster/dist/core/Reporter';
export default class MyCustomDetector extends Detector {
constructor(reporter: Reporter) {
super(reporter);
}
start() {
// Example: detect if user is idle for 10 seconds
this.timeout = setTimeout(() => {
this.reporter.notify('User appears idle for too long', null);
}, 10000);
}
stop() {
clearTimeout(this.timeout);
}
}
You can use the .use() method to inject custom detectors before starting Botbuster:
import Botbuster from 'botbuster';
import MyCustomDetector from './MyCustomDetector';
Botbuster.use(MyCustomDetector);
Botbuster.on((reason, event) => {
console.log('[Botbuster]', reason);
});
Custom detectors receive the same Reporter instance used by internal detectors.
Botbuster.start() is called.BotBuster allows fine-tuning of detector behavior via an optional configuration object. You can pass this configuration globally to BotBuster, or individually to specific detectors if needed.
const botbuster = new BotBuster({
jumpThreshold: 150, // px
linearityThreshold: 0.98, // 0–1
minClickDuration: 20, // ms
maxClickDuration: 800, // ms
edgeThreshold: 10, // px from edge
intervalMin: 5, // ms
intervalMax: 200, // ms
});
| Property | Type | Default | Description |
|---|---|---|---|
| jumpThreshold | number | 100 | Pixel threshold to detect a sudden mouse jump. Used by MouseJumpDetector. |
| linearityThreshold | number | 0.99 | Value between 0 and 1 defining how straight a movement must be to be considered suspicious. Used by MouseLinearityDetector. |
| minClickDuration | number | 30 | Minimum click duration in milliseconds. Shorter clicks are considered suspicious. Used by ClickDurationDetector. |
| maxClickDuration | number | 1000 | Maximum click duration in milliseconds. Longer clicks may indicate anomalies. |
| edgeThreshold | number | 5 | Pixel distance from the window edges to trigger edge click detection. Used by ClickEdgeDetector. |
| intervalMin | number | 10 | Minimum interval (in ms) between mouse movements. Used by MouseIntervalDetector. |
| intervalMax | number | 200 | Maximum interval (in ms) between mouse movements. Values outside this range may indicate automation. |
import { ClickEdgeDetector } from 'botbuster';
botbuster.use(new ClickEdgeDetector({
edgeThreshold: 15
}));
BotBuster is designed to work in modern browsers:
| Browser | Min Version |
|---|---|
| Chrome | 33 |
| Firefox | 18 |
| Safari | 7.1 |
| Edge | 12 |
| Opera | 20 |
| Feature | Chrome | Firefox | Safari | Edge | Opera | Notes |
|---|---|---|---|---|---|---|
document.visibilityState | 33 | 18 | 7.1 | 12 | 20 | Broad support |
visibilitychange event | 33 | 18 | 7.1 | 12 | 20 | Same |
window.blur/focus | 1 | 1 | 1 | 12 | 15 | Very old support |
document.activeElement | 1 | 1 | 1 | 12 | 15 | Very old support |
Note: Full feature support may vary depending on the detector used and API availability in each browser.
"Not all users are equal — some are bots, some are virtual, and some are real people."
Botbuster is not intended to block users but rather to understand the nature of user interaction. This allows your application to make responsible decisions regarding access, security checks, or adaptive content delivery.
Botbuster is intended solely for security research, user behavior analysis, and responsible feature adaptation.
This library does not collect, store, or transmit any personal data. It operates entirely on the client-side and serves as a heuristic tool to detect abnormal interaction patterns.
You must ensure that your use of this library complies with:
We discourage using Botbuster for invasive tracking or discriminatory gating. Its purpose is preventive and adaptive, not punitive.
See also: CODE_OF_CONDUCT.md and PRIVACY_NOTICE.md
To build and test the library locally:
git clone https://github.com/olaferlandsen/botbuster
cd botbuster
npm install
npm run build
npm run test
MIT © olaferlandsen
FAQs
Detect abnormal user behavior in the browser to identify bots or virtualized environments.
The npm package botbuster receives a total of 6 weekly downloads. As such, botbuster popularity was classified as not popular.
We found that botbuster 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.