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.
Quickly check to see if sub obejects exits in an object.
###Install npm install nullet
###Usage
Pass in the object, a string representation of the 'path' you want to check, and a default value if it doesn't exist. The default value can be a function if you want.
####Example
var nullet = require('nullet');
var person = {
firstName: 'Ron',
lastName: 'Swanson',
likes: {
food: {
meat: 'bacon',
drink: 'scotch'
},
instrument: 'saxaphone'
},
saySomething: function() { return 'No'; }
}
var nameOfPerson = nullet.get(person, 'firstName', 'No Name')
, favoriteMeat = nullet.get(person, 'likes.food.meat', 'No favorite meat')
, favoriteIcecream = nullet.get(person, 'likes.food.icecream', 'No favorite icecream')
, promptResult = nullet.get(person, 'saySomething', function() { return 'No response'; })()
, soundResult = nullet.get(person, 'barkLikeADog', function() { return 'Would not bark like a dog' })()
;
console.log("Name of person: " + nameOfPerson);
console.log("Favorite meat: " + favoriteMeat);
console.log("Favorite icecream: " + favoriteIcecream);
console.log("What did he say? " + promptResult);
console.log("Bark like a dog! " + soundResult);
/*
Name of person: Ron
Favorite meat: bacon
Favorite icecream: No favorite icecream
What did he say? No
Bark like a dog! Would not bark like a dog
*/
FAQs
Quickly check to see if sub objects of an object exist
The npm package nullet receives a total of 0 weekly downloads. As such, nullet popularity was classified as not popular.
We found that nullet 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.