
Security News
/Research
Compromised Injective SDK npm Package Exfiltrates Wallet Keys and Mnemonics
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.
proxy-extend
Advanced tools
Transparently extend any JS object, using ES6 Proxy.
Given some existing JS value, you may want to add some information to this value without actually modifying the original. The simplest way to do so is to create a wrapper around the value:
const someValue = getValue();
const someValueAnnotated = {
value: someValue,
status: 'ready',
};
One drawback of using a wrapper object, is that the newly annotated value now has a different interface from the original. That means that any consuming code will need to know about the wrapper and "unwrap" it do anything with it.
Using ES6 Proxy, we can make the wrapper have the same interface as the original value, allowing us to pass the wrapped value to any consuming code without the consumer needing to know whether it has been proxied or not.
import ProxyExtend from 'proxy-extend';
const user = { name: 'John' }; // Some value to be extended
const userExtended = ProxyExtend(user, { status: 'ready' });
// The extended value has the same interface as the original
userExtended.name; // 'John'
({ ...userExtended }); // { name: 'John' }
// But we can also access our annotation, if we know the name of the key
console.log(userExtended.status); // { status: 'ready' }
To make sure that we do not conflict with any existing properties on the original value, it is useful to use a Symbol as the key of the annotation:
import ProxyExtend from 'proxy-extend';
const user = { name: 'John' };
const meta = Symbol('meta'); // Private symbol
const userExtended = ProxyExtend(user, { [meta]: 'some metadata' });
userExtended.name; // 'John'
userExtended[meta]; // 'some metadata'
Due to the nature of Proxy, we can only use an object as target value. This library supports any JS object, including plain objects, arrays, functions, and class constructors. We also support a few kinds of primitives by emulating them using objects:
null (using an empty object)String)Number)FAQs
Transparently extend a JS object with additional properties (using ES6 Proxy)
The npm package proxy-extend receives a total of 76 weekly downloads. As such, proxy-extend popularity was classified as not popular.
We found that proxy-extend 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.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.

Security News
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.