Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@nexpress/rate-limiter-redis

Latest version: v0.4.7

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
npm package Publisher: hahabsw
5 Stars
0 Forks
5 Versions
92 Downloads
TypeScript Repo language

Scan summary

@nexpress/rate-limiter-redis was last scanned on 27 Nov 2026 at version 0.4.7. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions; the latest was published on 27 Nov 2026.
  • Findings: No rules fired in version 0.4.7.
  • Downloads: 92 downloads.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.4.7 LATEST 27 Nov 2026 No rules fired
0.4.6 19 Aug 2026 No rules fired
0.4.5 17 Aug 2026 No rules fired
0.4.4 16 Aug 2026 Not shown
0.4.3 15 Aug 2026 Not shown

No rules fired in 0.4.7

Findings

Findings for v0.4.7. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.4.7; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@nexpress/rate-limiter-redis

Redis-backed NpRateLimiterAdapter for multi-node NexPress deployments.

The default InMemoryRateLimiter shipped in @nexpress/core keeps per-IP buckets in a process-local Map, which means the effective limit on a 4-node cluster is 4 × configured. Swap in this adapter at boot to share the bucket across every instance.

Install

pnpm add @nexpress/rate-limiter-redis

ioredis is bundled as a regular dependency — there's no peer contract to satisfy.

Usage

// src/proxy.ts — the proxy is a separate runtime entrypoint.
import { npCreateProxy } from "@nexpress/app/proxy";
import { RedisRateLimiter } from "@nexpress/rate-limiter-redis";

export const proxy = npCreateProxy({
  rateLimiter: new RedisRateLimiter({ url: process.env.NP_REDIS_URL }),
});

export const config = {
  matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
};

Set NP_RATE_LIMIT_ADAPTER=custom. Installing the adapter only from the application bootstrap is not reliable because it may not execute in the proxy runtime.

Three constructor shapes:

// 1. Connection string (most common).
new RedisRateLimiter({ url: "redis://localhost:6379" });

// 2. ioredis options (host/port/password/TLS/etc.).
new RedisRateLimiter({ host: "redis.internal", port: 6379, db: 1 });

// 3. Reuse an existing ioredis client (e.g. shared with caching).
//    The adapter does NOT close the client on shutdown() in this
//    mode — the caller owns the lifecycle.
const client = new Redis(process.env.NP_REDIS_URL);
new RedisRateLimiter({ client });

Optional keyPrefix (defaults to "nx:rl:") lets two NexPress deploys share a Redis without colliding:

new RedisRateLimiter({ url, keyPrefix: "myapp:rl:" });

How it works

A single Lua script issues INCR + PTTL + a conditional PEXPIRE in one round trip per request. That gives:

  • Atomicity — no race where two concurrent requests both see count <= limit because the increment happens server-side.
  • TTL safety — a crash between INCR and EXPIRE in a naive two-step implementation would strand a key without a TTL. The Lua script sets the TTL inside the same call so the bucket always expires.
  • One round trip per check — the proxy's hot path stays cheap.

Sliding-window or token-bucket semantics are outside the current pre-1.0 contract; the adapter implements the same fixed-window contract as InMemoryRateLimiter so behavior is identical to single-node deploys.

Shutdown

await limiter.shutdown() is idempotent and closes clients owned by cases 1 and 2 above. It is a no-op for a shared client. Call it from an existing application shutdown coordinator or from tests; do not add a competing signal handler when the NexPress job worker already owns SIGINT/SIGTERM.

Tests

The unit suite stubs ioredis. To run the optional live Redis integration test:

docker compose -f docker/docker-compose.yml --profile redis up -d redis
TEST_REDIS_URL=redis://localhost:6379 pnpm --filter @nexpress/rate-limiter-redis test

When TEST_REDIS_URL is unset, the live integration test is skipped.

License

MIT

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @nexpress/rate-limiter-redis

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229