Scan your whole stack
From OX Research Newsroom
Are you using @nathapp/nestjs-common?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v4.6.1
@nathapp/nestjs-common was last scanned on 27 Nov 2026 at version 4.6.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 4.6.1 LATEST | 27 Nov 2026 | No rules fired |
| 4.6.0 | 27 Nov 2026 | No rules fired |
| 4.5.1 | 24 Nov 2026 | No rules fired |
| 4.5.0 | 23 Nov 2026 | Not shown |
| 4.4.0 | 22 Nov 2026 | Not shown |
Findings for v4.6.1. 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 4.6.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
this is a NestJs Common Library, can be use on fastify and express
1.) I18n - I18nCoreModule
LOCALES_FALLBACK_LANGUAGE=en_US ##language fallback
LOCALES_MAP_PATH= ##override i18n loaderOptions.path
LOCALES_LIVE_RELOAD=true ## enable loaderOptions live reload for development
Keep LOCALES_LIVE_RELOAD unset or false in production. Live reload watches
the locale directory configured by LOCALES_MAP_PATH; use a directory path,
not a glob pattern.
nestjs-i18n 10.x still depends on chokidar 3, which pulls in braces affected
by GHSA-vfj7-8cjw-p6xm.
This monorepo uses the same targeted chokidar 4 override as the sibling
notification and outbox provider repos. npm overrides do not propagate from
published libraries, so consuming applications must add this to their own
root package.json until upstream removes the vulnerable dependency:
{
"overrides": {
"nestjs-i18n": {
"chokidar": "^4.0.0"
}
}
}
Run npm install and npm audit after adding the override. Avoid
npm audit fix --force, which currently proposes downgrading nestjs-i18n
to an incompatible major version.
2.) LoggerUtils & LoggerMiddleware
DEBUG_MODE=1 ## Logger log Level
HTTP_LOG_USER_AGENT=1 ## log User Agent on request
HTTP_LOG_REQUEST=1 ## log request data (query, params, body) on request
HTTP_LOG_RESPONSE=1 ## log response data on request
HTTP_LOG_SENSITIVEKEYS=pwd,secret ## censor log response data with the keys, value is in comma separated
When your application runs behind a reverse proxy (Cloudflare, AWS ALB, nginx), client IP addresses appear as the proxy's IP. Attackers can spoof X-Forwarded-For headers to bypass rate limiting or hide their identity.
Default in 3.0.0: Trust proxy is DISABLED (fail-closed). You must explicitly configure trusted proxies.
import { configureTrustProxy } from '@nathapp/nestjs-common';
// Cloudflare
configureTrustProxy(app, { provider: 'cloudflare' });
// AWS Application Load Balancer
configureTrustProxy(app, { provider: 'aws-alb' });
// Private networks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
configureTrustProxy(app, { provider: 'private' });
// Localhost only
configureTrustProxy(app, { provider: 'loopback' });
// Link-local addresses (169.254.0.0/16, fe80::/10)
configureTrustProxy(app, { provider: 'linklocal' });
configureTrustProxy(app, {
trustedProxies: [
'203.0.113.0/24', // Your proxy subnet
'2001:db8::/32', // IPv6 range
'10.0.0.1', // Single IP
]
});
v2.x behavior: Trust all proxies by default (security risk).
v3.0.0 behavior: Trust no proxies by default. Explicitly configure:
// Before (2.x) - implicit trust-all
// No configuration needed
// After (3.0.0) - explicit configuration required
configureTrustProxy(app, { provider: 'cloudflare' });
Cloudflare → Your Server:
configureTrustProxy(app, { provider: 'cloudflare' });
AWS ALB → ECS/EC2:
configureTrustProxy(app, { provider: 'aws-alb' });
nginx (10.0.0.0/24) → App:
configureTrustProxy(app, { trustedProxies: ['10.0.0.0/24'] });
Multiple Layers (Cloudflare → nginx → App):
configureTrustProxy(app, {
trustedProxies: [
...resolveProviderCidrs('cloudflare'),
'10.0.0.0/24', // Your nginx subnet
]
});
Do not configure 0.0.0.0/0 or ::/0 unless every address in that IP family
is a trusted proxy. Those CIDRs trust every hop in their family, leaving no
untrusted-hop boundary in the forwarding chain. Returned X-Forwarded-For entries
are syntactically validated, but their client provenance then depends on the
ingress proxy removing client-supplied forwarding headers and writing its own.
import { ExceptionModule } from '@nathapp/nestjs-common';
@Module({
imports: [
ExceptionModule.forRoot({
handlers: [MyCustomExceptionHandler],
}),
],
})
export class AppModule {}
Handlers are executed in registration order. First matching handler wins:
import { IExceptionHandler } from '@nathapp/nestjs-common';
export class DatabaseExceptionHandler implements IExceptionHandler {
canHandle(exception: unknown): boolean {
return exception instanceof DatabaseException;
}
handle(exception: DatabaseException, host: ArgumentsHost): void {
const ctx = host.switchToHttp();
const response = ctx.getResponse();
response.status(503).json({
error: 'Database temporarily unavailable',
});
}
}
import { GlobalExceptionFilter } from '@nathapp/nestjs-common';
export class AppService {
constructor(private globalFilter: GlobalExceptionFilter) {}
onModuleInit() {
this.globalFilter.registerHandler(new RateLimitExceptionHandler());
}
}
# Outbound HTTP guard
`GuardedHttpClient` and `assertOutboundUrl` protect server-side requests to URLs that a tenant or client can influence (OIDC discovery, token and JWKS URLs, dynamic-registration `jwks_uri`). Plain `fetch` accepts any scheme, follows redirects, has no timeout or size cap and reaches private networks.
## What is blocked by default
- Schemes other than `https:` (`http:` only with `allowHttp` or an allow-listed host).
- URLs with userinfo (`https://user:pw@host/`).
- Any host whose address is not public unicast: private, loopback, link-local (including `169.254.169.254`), carrier-grade NAT, unique-local, unspecified, multicast, broadcast, reserved and transition ranges. IPv4-mapped IPv6 (`::ffff:127.0.0.1`) is classified by its IPv4 part. Also blocked: IPv4-compatible IPv6 (`::/96`), local-use NAT64 (`64:ff9b:1::/48`), site-local (`fec0::/10`), IPv6 documentation (`3fff::/20`) and SRv6 SIDs (`5f00::/16`). `localhost` and `*.localhost` are blocked without DNS.
- Hostnames are resolved with all answers checked; if any answer is blocked, the request is refused. DNS failure is refused.
- Redirects (any 3xx) are never followed.
- Exchanges slower than `timeoutMs` (covers the body read) and bodies larger than `maxBytes`.
Failures reject with `OutboundUrlBlockedError`, whose `reason` is one of `invalid-url`, `scheme`, `credentials`, `private-address`, `dns-failure`, `redirect`, `timeout`, `too-large`, `network`. Its `url` field (origin and pathname only) is safe to log.
## Policy
| Field | Default | Meaning |
|-------|---------|---------|
| `allowedHosts` | `[]` | Hostnames that skip the IP-range check. Exact match, case-insensitive, trailing dot ignored, no wildcards. |
| `allowHttp` | `false` | Permit `http:` for any host. An allow-listed host may always use `http:`. |
| `timeoutMs` | `5000` | Positive integer. Whole-exchange timeout. |
| `maxBytes` | `1048576` | Positive integer. Maximum response body size. |
Invalid numeric values throw a `TypeError` naming the field when the policy is resolved (`resolveOutboundHttpPolicy`) or the client is constructed.
## Escape hatch
To reach an in-cluster service such as a Keycloak on a private address, list its hostname in `allowedHosts`. That host skips the address check only; credentials in the URL, redirects, timeout and size limits still apply.
## Usage
```typescript
import { GuardedHttpClient, OutboundUrlBlockedError } from '@nathapp/nestjs-common';
const http = new GuardedHttpClient({ allowedHosts: ['keycloak.auth.svc.cluster.local'], allowHttp: false });
try {
const res = await http.get(`${issuer}/.well-known/openid-configuration`);
if (!res.ok) throw new Error(`discovery failed: ${res.status}`);
const config = await res.json();
const token = await http.postForm(tokenUrl, { grant_type: 'authorization_code', code }, { accept: 'application/json' });
} catch (error) {
if (error instanceof OutboundUrlBlockedError) {
logger.warn(`blocked ${error.reason} ${error.url}`);
}
throw error;
}
Non-2xx responses are returned, not thrown. json() rejects with the native SyntaxError on invalid JSON.
GuardedHttpClient resolves each guarded hostname once per request. Its native HTTP(S) transport connects using only the checked addresses and keeps the original hostname for HTTP and TLS. Hosts in allowedHosts use normal DNS resolution.
The standalone assertOutboundUrl() checks a URL at lookup time. Use GuardedHttpClient when the connection must use those same addresses. The optional deps.fetch transport override is intended for test doubles.
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.