Scan your whole stack
From OX Research Newsroom
Are you using @nexpress/rate-limiter-redis?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.4.7
@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.
| Version | Published | Status |
|---|---|---|
| 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 |
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.
The publisher’s own README, as collected from the registry.
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.
pnpm add @nexpress/rate-limiter-redis
ioredis is bundled as a regular dependency — there's no peer
contract to satisfy.
// 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:" });
A single Lua script issues INCR + PTTL + a conditional
PEXPIRE in one round trip per request. That gives:
count <= limit because the increment happens server-side.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.
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.
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.
MIT
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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.