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.
deep-property
Advanced tools
Enables deep property manipulation and inspection without worrying about exceptions.
npm install deep-property
var props = require('deep-property'),
sample = { };
props.set(sample, 'name.first', 'John');
props.set(sample, 'name.middle', 'C');
props.set(sample, 'name.last', 'Reilly');
props.set(sample, 'job.title', 'Actor');
props.get(sample, 'name.first'); // John
props.get(sample, 'name.middle'); // C
props.get(sample, 'name.last'); // Reilly
props.get(sample, 'job.title'); // Actor
props.remove(sample, 'name.middle'); // True
props.has(sample, 'name.first'); // True
props.has(sample, 'name.title'); // False
props.has(sample, 'job.title'); // True
props.has(sample, 'job.salary'); // False
// Resulting object
{
name: {
first: 'John',
last: 'Reilly'
},
job: {
title: 'Actor'
}
}
The path
parameter of each function is dot-delimited string. Everything
between the dots is considered a property name. Paths can be as long and
complex as necessary, with the following constraints and assumptions:
items[4]
(string) instead of an array element.get
: undefined
set
: No values (including intermediates) sethas
: false
remove
: false
path.to..nothing
or path.to.nothing.
)
will be considered invalid.FAQs
Fetch, set, and test deeply nested object properties
The npm package deep-property receives a total of 412 weekly downloads. As such, deep-property popularity was classified as not popular.
We found that deep-property 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.