npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blackhat955/ultimate-security-pack

v1.0.0

Published

A comprehensive security package for Node.js applications, aggregating best-in-class security features.

Readme

Ultimate Security Pack

A comprehensive security package for Node.js applications, aggregating best-in-class security features.

Installation

npm install @blackhat955/ultimate-security-pack

Features

  • Security Headers: Wrapper around helmet.
  • XSS Protection: Input sanitization and middleware using xss.
  • Rate Limiting: Configurable rate limiter using rate-limiter-flexible.
  • Input Validation: Common validators (email, strong password, etc.) using validator.
  • Injection Protection: SQL and NoSQL sanitization helpers.
  • CSRF Protection: Token generation and validation using csrf-csrf.
  • CORS Hardening: Allowlist support and strict defaults.
  • Auth Hardening: Cookie and JWT helpers.
  • Request Limits: Strict body parsing limits.
  • File Upload Security: MIME sniffing and extension validation.
  • Logging/Audit: Security-focused logger with redaction.
  • Bot Protection: Basic user-agent blocking.
  • SSRF Protection: URL validation and private IP blocking.
  • Open Redirect Guard: Safe redirect middleware.
  • Cache Control: Strict headers for sensitive routes.
  • Security.txt: Serve well-known security files.

Usage

1. Security Headers (Helmet)

const express = require('express');
const { headers } = require('@blackhat955/ultimate-security-pack');
const app = express();

app.use(headers());

2. XSS Protection

const { xss } = require('@blackhat955/ultimate-security-pack');
app.use(xss.xssMiddleware());

3. Rate Limiting

const { ratelimit } = require('@blackhat955/ultimate-security-pack');
app.use(ratelimit({ points: 10, duration: 1 }));

4. CORS Hardening

const { cors } = require('@blackhat955/ultimate-security-pack');

app.use(cors({
  allowedOrigins: ['https://example.com'],
  onBlock: (origin) => console.log(`Blocked origin: ${origin}`)
}));

5. Auth Hardening

const { auth } = require('@blackhat955/ultimate-security-pack');

// Cookie options
res.cookie('session', 'value', auth.secureCookieOptions());

// JWT Validation
try {
  const decoded = auth.validateToken(token, 'secret');
} catch (err) {
  // invalid token
}

6. Request Limits

const { requestLimits } = require('@blackhat955/ultimate-security-pack');

// Applies strict json/urlencoded limits
app.use(requestLimits({ jsonLimit: '10kb' }));

7. File Upload Security

const { fileUpload } = require('@blackhat955/ultimate-security-pack');

// Check buffer mime type
const isValid = await fileUpload.validateFileContent(fileBuffer);

// Check extension
const isExtValid = fileUpload.validateExtension('image.jpg');

8. Logging (Audit)

const { logging } = require('@blackhat955/ultimate-security-pack');

app.use(logging.middleware()); // Adds correlation ID

logging.log('login-failed', 'Invalid password for user', { 
  user: 'admin', 
  password: 'secret_password_redacted' 
});

9. Bot Protection

const { botProtection } = require('@blackhat955/ultimate-security-pack');

app.use(botProtection({ 
  blockUserAgents: ['curl', 'python'],
  onBlock: (ip, ua) => console.log(`Blocked bot ${ua} from ${ip}`)
}));

10. SSRF Protection

const { ssrf } = require('@blackhat955/ultimate-security-pack');

if (ssrf.validateUrl(userInputUrl)) {
  // Safe to fetch
}

11. Open Redirect Guard

const { openRedirect } = require('@blackhat955/ultimate-security-pack');

app.use(openRedirect.safeRedirect({ allowedHosts: ['example.com'] }));

// Now res.redirect() checks the URL
res.redirect(userInputUrl);

12. Cache Control (Sensitive Routes)

const { cacheControl } = require('@blackhat955/ultimate-security-pack');

app.get('/profile', cacheControl(), (req, res) => {
  res.json({ user: 'data' });
});

13. Security.txt & Robots.txt

const { securityTxt } = require('@blackhat955/ultimate-security-pack');

app.use(securityTxt.securityTxt({ contact: 'mailto:[email protected]' }));
app.use(securityTxt.robotsTxt());

License

ISC