
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@certchip/jsotp
Advanced tools
This project is based on LanceGin's jsotp project 1.0.4 and is a modified version with the following contents.
jsotp is a node module to generate and verify one-time passwords that were used to implement 2FA and MFA authentication method in web applications and other login-required systems.
The module was implement based on RFC4226 (HOTP: An HMAC-Based One-Time Password Algorithm) and RFC6238 (TOTP: Time-Based One-Time Password Algorithm)

otpauth url with the b32 encoded stringnpm install jsotp
All modules support:
const jsotp = require('jsotp');
// import
const jsotp = require('jsotp');
// Create TOTP object
const totp = jsotp.TOTP('BASE32ENCODEDSECRET');
totp.now(); // => 432143
// Verify for current time
totp.verify(432143); // => true
// Verify after 30s
totp.verify(432143); // => false
// import
const jsotp = require('jsotp');
// Create HOTP object
const hotp = jsotp.HOTP('BASE32ENCODEDSECRET');
hotp.at(0); // => 432143
hotp.at(1); // => 231434
hotp.at(2132); // => 242432
// Verify with a counter
hotp.verify(242432, 2132); // => true
hotp.verify(242432, 2133); // => false
// import
const jsotp = require('jsotp');
// Generate
const b32_secret = jsotp.Base32.random_gen();
param: length
type: int
default: 16
return: String
desc: the length of random base32 encoded string.
param: secret
type: string
return: TOTP
desc: generate TOTP instance.
return: String
desc: get the one-time password with current time.
param: totp
type: string
return: Boolean
desc: verify the totp code.
param: issuer
type: string
return: string
desc: generate url with TOTP instance
param: secret
type: string
return: HOTP
desc: generate HOTP instance.
param: counter
type: int
return: String
desc: generate one-time password with counter.
param: hotp
type: string
param: count
type: int
return: Boolean
desc: verify the hotp code.
param: issuer
type: string
return: string
desc: generate url with HOTP instance
git clone git@github.com:certchip/jsotp.git
npm install
src/, and run command below to build the es6 code to es2015. That will create a local directory named lib/.npm run build
npm test
FAQs
Javascript One-Time Password module.
We found that @certchip/jsotp 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.