Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@mongodb-js/saslprep
Advanced tools
SASLprep: Stringprep Profile for User Names and Passwords, rfc4013
The @mongodb-js/saslprep package is a Node.js implementation of the SASLprep algorithm, which is used for preparing strings for use in Simple Authentication and Security Layer (SASL) mechanisms, such as SCRAM (Salted Challenge Response Authentication Mechanism). It's particularly useful for sanitizing and normalizing user passwords before they are sent over the network for authentication purposes.
String preparation for SCRAM authentication
This feature allows you to prepare a string (typically a password) for use in SCRAM authentication by applying the SASLprep algorithm. It normalizes the string, which includes removing prohibited output, mapping input, and normalizing the string using Unicode normalization form KC (NFKC).
const saslprep = require('@mongodb-js/saslprep');
const prepared = saslprep('user\u00A0password');
console.log(prepared); // Outputs the prepared string, with non-ASCII space characters replaced, etc.
This package provides similar functionality to @mongodb-js/saslprep. It implements the SASLprep algorithm for preparing strings for use in SASL mechanisms. The main difference is that it may be maintained by different authors or have slightly different API designs or dependencies.
The stringprep package is an older implementation of the string preparation algorithms, including SASLprep. It is based on the now-deprecated node-stringprep package. Compared to @mongodb-js/saslprep, it may not be as up-to-date or maintained, and it might have more dependencies since it was built for older versions of Node.js.
Note: This is a fork of the original saslprep
npm package
and provides equivalent functionality.
Stringprep Profile for User Names and Passwords, rfc4013
const saslprep = require('@mongodb-js/saslprep');
saslprep('password\u00AD'); // password
saslprep('password\u0007'); // Error: prohibited character
saslprep(input: String, opts: Options): String
Normalize user name or password.
Options.allowUnassigned: bool
A special behavior for unassigned code points, see https://tools.ietf.org/html/rfc4013#section-2.5. Disabled by default.
MIT, 2017-2019 (c) Dmitriy Tsvettsikh
FAQs
SASLprep: Stringprep Profile for User Names and Passwords, rfc4013
The npm package @mongodb-js/saslprep receives a total of 3,045,191 weekly downloads. As such, @mongodb-js/saslprep popularity was classified as popular.
We found that @mongodb-js/saslprep demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 33 open source maintainers 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.