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.
Nagoya is a validation library for writing cool and arbitrary validation schemas and producing user-friendly validation error messages.
import * as nagoya from 'nagoya';
const schema = {
username(username) {
nagoya.isString(username, 'not a string', TypeError);
nagoya.isAlphanumeric(username, 'must contain only letters and numbers');
// alternatively nagoya.matches(username, /^\w*$/)
nagoya.isMinLength(username, 3, 'must be at least 3 characters long');
nagoya.isMaxLength(username, 30, 'cannot be more than 30 characters long');
},
password(password) {
nagoya.isString(username, 'not a string', TypeError);
nagoya.isMinLength(username, 8, 'must be at least 8 characters long');
nagoya.isMaxLength(username, 30, 'cannot be more than 30 characters long');
},
email(emailAddress) {
nagoya.isEmail(emailAddress, 'must be a valid email address');
}
};
const validate = nagoya.schema(schema);
try {
validate({
username: '*asdf^',
password: 'foo321',
email: 'bob@@foo.com'
});
} catch (err) {
console.log(err.message);
console.log(err.columns);
}
// ValidationError: username must contain only letters and numbers,
// password must be at least 8 characters long,
// email must be a valid email address
// {
// username: [ValidationError: must contain only letters and numbers],
// password: [ValidationError: must be at least 8 characters long],
// email: [ValidationError: must be a valid email address]
// }
TODO
FAQs
Opinionated? validation library
The npm package nagoya receives a total of 3 weekly downloads. As such, nagoya popularity was classified as not popular.
We found that nagoya 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
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.