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.
Accessed is a simple module that allows you to track property access of a given
object to ensure that only the data that is used (or not used) is included when
you JSON.stringify
the data.
The module is published in the public npm registry and can be installed by running:
npm install --save accessed
const accessed = require('accessed');
const data = accessed({
foo: 'bar',
bar: 'wat',
key: 'value'
});
console.log(data.foo);
console.log(JSON.stringify(data)); // {"foo":"bar"}
console.log(data.bar);
console.log(JSON.stringify(data)); // {"foo":"bar", "bar": "wat"}
The module exposes the accessed
function as default export. The function
accepts 2 arguments.
data
The object that needs to be tracked.options
Additional configuration
keys
An array of keys that should be included, even when they are not
accessed by the code.exclude
Instead of returning an object on JSON.stringify
that represents
the keys that were accessed, return the data that was not accesed.const data = accessed({ foo: 'bar', hello: 'world' }, {
keys: ['hello']
});
console.log(JSON.stringify(data)); // {"hello":"world"}
FAQs
Only JSON.stringify the properties that we're accessed on the object.
We found that accessed 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.