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.
node-random-string
Advanced tools
To create a random string.
To install node-random-string, use npm:
npm i node-random-string -S
import randomString from 'node-random-string';
randomString();
/* '1Uobd2CVV2mXwc7F7yKCvLRVgUBDH3DB' */
randomString(12);
/* 'uU4u1QyytM4U' */
randomString({
length: 12,
charset: 'alphabetic'
});
/* 'nORLfqUfkuxn' */
randomstring({
chars: 'abc'
});
/* 'bbcaaccbacccccbabacacbacabbcbccb' */
randomString({
length: 12,
upperCase: true
});
/* 'FQVI8YMT1D81' */
length
- define the length of the string. (default: 32) [OPTIONAL]charset
- define the character set for the string. (default: [0-9 a-z A-Z]) [OPTIONAL]
alphabetic
- [a-z A-Z]numeric
- [0-9]chars
- define the characters of the string. (default: null) [OPTIONAL]lowerCase
- define whether the output should be lowercase only. (default: null) [OPTIONAL]upperCase
- define whether the output should be uppercase only. (default: null) [OPTIONAL]npm install
npm test
FAQs
To create random string
We found that node-random-string 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
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.