
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
static-type-js
Advanced tools
Type checking support for javascript
/// var Parent = Type.create([type definition], [prototype]);
/// var Child = Parent.inherit([type definition], [prototype]);
var AdminUser, Group, User;
Group = Type.create({
_group: Type.STRING,
invoked: Type.STRING
}, {
_invoke: function(group) {
this.invoked = group;
},
_construct: function(group) {
this._group = group;
},
setGroup: function(value) {
this._group = value;
},
getGroup: function() {
return this._group;
}
});
AdminUser = Group.inherit({
username: Type.STIRNG,
date: Type.DATE
},{
_construct: function(username) {
this.username = username;
this.date = new Date;
this._super('admin'); /// this will override group because parent is group
},
setUser: function(value) {
this.username = value;
}
});
User = AdminUser.inherit({
username: Type.STIRNG,
date: Type.DATE
},{
_construct: function(username) {
this.username = username;
this.date = new Date;
this._super('test'); // this will override username to test because parent is AdminUser
this.setGroup('user'); // this will set group to user
},
setPassword: function(value) {
// this is not allowed all members must be defined at initialization proces (in _construct)
this.password = value;
}
});
var user = new User('igor');
user.username = 1; // throws type error because initial value is string
user.date = new RegExp; // throw type error because initial value is date
user.date = new Date; // is allowed because is correct type
user.date = null; // its allowed because all members are allowed to be null or undefined because of GC
user.date = 1; // re assigning values with wrong type throws type error
user.date = new Date; // re assigning initial value is allowed
User.prototype.one = 1; // Will throw type error because adding something to prototype after initialization is not allowed
User.one = 1; // Extending roots is not allowed
FAQs
Prototype inheritance and type system for js
We found that static-type-js 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 malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.