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.
A JSON database with Models, Schemas, and a flexible querying interface. It powers the wildly successful static site generator Hexo.
$ npm install warehouse
In warehouse@3
, the constructor has been changed from function declaration to class
declaration or definition by class
expression.
Derived classes of classes defined by class
declarations and class
expressions must also be defined in class
declaration, class
expression.
Anyone who created their own SchemaType will need to change.
const SchemaType = require('warehouse/schematype');
class MySchemaType extends SchemaType {
constructor(name, options = {}) {
super(name, Object.assign({ foo: 'foo' }, options));
}
}
It changes to a class declaration or a class expression, but it does not need to deal with other than the definition of the constructor.
// It work!
MySchemaType.prototype.cast = function (value, data) {
let result = SchemaType.prototype.cast.call(this, value, data);
return result ? result : '';
}
var Database = require('warehouse');
var db = new Database();
var Post = db.model('posts', {
title: String,
created: {type: Date, default: Date.now}
});
Post.insert({
title: 'Hello world'
}).then(function(post){
console.log(post);
});
$ npm test
FAQs
Simple JSON-based database
We found that warehouse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.