Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
graphql-nestjs-fingerprint
Advanced tools
Server-side fingerprinting library for framework NestJs & Graphql
Server-side fingerprinting library for framework NestJs & Graphql
this package is based on another package: nestjs-fingerprint author l1ttps
Start by installing the necessary packages using your package manager:
npm install --save @nestjs/graphql @nestjs/apollo @apollo/server graphql
yarn add @nestjs/graphql @nestjs/apollo @apollo/server graphql
pnpm add @nestjs/graphql @nestjs/apollo @apollo/server graphql
npm install --save graphql-nestjs-fingerprint
yarn add graphql-nestjs-fingerprint
pnpm add graphql-nestjs-fingerprint
app.module.ts
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import { GraphQLModule } from '@nestjs/graphql';
import { Module } from '@nestjs/common';
import { join } from 'node:path';
import { NestjsFingerprintModule } from 'nestjs-fingerprint';
import { AppResolver } from './AppResolver';
import { AppService } from './app.service';
@Module({
imports: [
GraphQLModule.forRoot<ApolloDriverConfig>({
driver: ApolloDriver,
autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
context: ({req, res}) => ({req, res}) // important
}),
NestjsFingerprintModule.forRoot({
params: ['headers', 'userAgent', 'ipAddress'],
cookieOptions: {
name: 'your_cookie_name', // optional
httpOnly: true, // optional
},
}),
],
providers: [AppService, AppResolver],
})
export class AppModule {}
app.resolver.ts
import { Query } from '@nestjs/graphql';
import { Resolver } from '@nestjs/graphql';
import { Fingerprint, IFingerprint, RealIp } from 'graphql-nestjs-fingerprint';
@Resolver()
export class AppResolver {
@Query(() => String)
getFingerPrint(@Fingerprint() fp: IFingerprint): IFingerprint {
return fp;
}
@Query(() => String)
getMyIpAddress(@RealIp() ipAddress: string): string {
return ipAddress;
}
}
Fingerprint example:
{
"id": "79c0678d8672fafb932a97a1368d7bf3",
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"language": "en-US,en;q=0.9"
},
"userAgent": {
"browser": {
"family": "Chrome",
"version": "xxx"
},
"device": {
"family": "Other",
"version": "0"
},
"os": {
"family": "Windows",
"major": "10",
"minor": "0"
}
},
"ipAddress": {
"value": "xxx.xxx.xxx.xxx"
}
}
MIT © dilanjer
FAQs
Server-side fingerprinting library for framework NestJs & Graphql
The npm package graphql-nestjs-fingerprint receives a total of 175 weekly downloads. As such, graphql-nestjs-fingerprint popularity was classified as not popular.
We found that graphql-nestjs-fingerprint demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.