
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@s3pweb/nestjs-common
Advanced tools
A repo containing all the common utilities for our NestJS projects:
npm i @s3pweb/nestjs-common
On a controller to protect all routes:
@Controller('v1/cats')
@IpWhitelist('0.0.0.0', '::1')
@UseGuards(IpWhitelistGuard)
export class CatsController {}
Directly on a route (with the guard on the controller):
@Post()
@IpWhitelist('192.168.1.1')
async createCat() {}
To use the LoggingModule, add it to the imports of the AppModule, and then:
@Injectable()
export class Service {
private readonly log: any;
constructor(
logger: LoggingService,
) {
this.log = logger.getLogger(Service.name);
}
}
To be able ton inject it correctly, you need a metrics module exporting a service implementing the MetricsInterface:
@Global()
@Module({
providers: [
{
provide: METRICS_SERVICE,
useClass: PromService,
},
],
controllers: [PromController],
exports: [
{
provide: METRICS_SERVICE,
useClass: PromService,
},
],
})
export class PromModule {
// -- Empty
}
To use the PromService in a Controller or a Service, you can inject it in a constructor with:
@Inject(METRICS_SERVICE) private readonly metricsService: PromService,
This interface enables you to implements the required functions for the LoggingService.
This middleware will add a new header in each request and response X-Correlation-Id, this is an uuid V1 string (different for each request/response).
It was lifted from https://github.com/eropple/nestjs-correlation-id/
To set the middleware everywhere (in the bootstrap function of main.ts):
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// Tracking ID
app.use(CorrelationIdMiddleware());
// ...
}
You can then get the uuid in a controller:
@Controller('v1/cats')
export class CatsController {
@Post()
async createCat(
@Headers(correlationId) uuid: string,
) {
// console.log(uuid)
}
}
This middleware will log as a warning all failed HTTP request (with their uuid) to provide more details when an error occurs.
Example: NotFoundException: Cannot GET /cats/v2/api/
To set the middleware everywhere (in the bootstrap function of main.ts):
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// Use our logger for all Nest logs
const logger = await app.resolve(LoggingService);
app.useLogger(logger);
// Add custom filter to log all http errors
const { httpAdapter } = app.get(HttpAdapterHost);
app.useGlobalFilters(new ExceptionsLoggerFilter(logger, httpAdapter));
}
FAQs
A NestJS guard to authorise only the given IP(s)
The npm package @s3pweb/nestjs-common receives a total of 0 weekly downloads. As such, @s3pweb/nestjs-common popularity was classified as not popular.
We found that @s3pweb/nestjs-common demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.