
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
A simple JWT module for Angular applications
npm i @nwx/jwt |OR| yarn add @nwx/jwt
// In your environment{prod,staging}.ts
import { AppCfg, TargetPlatform } from '@nwx/cfg';
import { LogLevels } from '@nwx/logger';
export const environment: AppCfg = {
// app name
appName: '@nwx/jwt',
// target (browser, mobile, desktop)
target: TargetPlatform.web,
// production, staging or development
production: false,
log: {
// log level (application-wide)
level: LogLevels.debug
},
jwt: {
// estimate time of http request between client -> server (greater than zero)
networkDelay: 1,
// few seconds to make the randomizer work. backend can overwrite
expiryLeeway: 5
}
};
// In your app.module.ts
import { CfgModule } from '@nwx/cfg';
import { LoggerModule } from '@nwx/logger';
import { JwtModule } from '@nwx/jwt';
import { environment } from '../environments/environment';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
CfgModule.forRoot(environment), // make the environment injectable
LoggerModule,
JwtModule
],
bootstrap: [AppComponent]
})
export class AppModule {}
// In your app.module.ts
import { Component } from '@angular/core';
import { CfgService, DefaultCfg } from '@nwx/cfg';
import { LogService } from '@nwx/logger';
import { jwtService } from '@nwx/jwt';
@Component({
selector: 'app-root',
template: `<h1>Welcome to {{ title }}!</h1>`
})
export class AppComponent {
title = 'Neekware';
options = {};
constructor(public cfg: CfgService, public log: LogService, public jwt: JwtService) {
this.title = this.cfg.options.appName;
this.log.info('AppComponent loaded ...');
const someToken = 'some-jwt-token-received-from-server'; // <part-1>.<part-2>.<part-2>
const payload = this.jwt.getPayload(someToken);
const isExpired = this.jwt.isExpired(payload);
if (!isExpired) {
const userId = payload.sub;
const nextRefresh = this.jwt.getRefreshTime(payload);
setTimeout(() => {
// connect to the server to get a new token
}, nextRefresh * 1000);
}
}
}
To run the tests against the current environment:
npm run ci:all
Released under a (MIT) license.
X.Y.Z Version
`MAJOR` version -- making incompatible API changes
`MINOR` version -- adding functionality in a backwards-compatible manner
`PATCH` version -- making backwards-compatible bug fixes
1.0.3
Enhancements:
FAQs
A simple JWT module for Angular applications
The npm package @nwx/jwt receives a total of 12 weekly downloads. As such, @nwx/jwt popularity was classified as not popular.
We found that @nwx/jwt 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.