
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
virtual-proxy
Advanced tools
More permisive proxy objects by separating invariant bookkeeping from the target object.
The Proxy API enables powerful reflection on JavaScript objects. However, it is constrained by strict invariants, such as requiring proxies to report consistent values for immutable properties (i.e., non-configurable and non-writable). While these invariants are essential for ensuring the consistent behavior of JavaScript objects, the current implementation imposes unnecessary limitations by using the target object for bookkeeping.
This module introduces a mechanism to decouple the target object from the bookkeeping process, enabling more flexible and versatile use of proxies.
import { VirtualProxy, setupVirtualHandler } from "../lib/index.mjs";
const target = Object.freeze({
name: "John",
password: "1234",
});
const handler = {
get: (target, key, receiver) =>
key === "password" ? "****" : Reflect.get(target, key, receiver),
};
// 1) Proxy
{
// TypeError: 'get' on proxy: property 'password' is a read-only and
// non-configurable data property on the proxy target but the proxy
// did not return its actual value
const proxy = new Proxy(target, handler);
console.log(proxy.password);
}
// 2) VirtualProxy
{
const integrity = {};
const proxy = new VirtualProxy(integrity, target, handler);
console.log(proxy.password); // ****
}
// 3) setupVirtualHandler
{
const integrity = {};
const proxy = new Proxy(integrity, setupVirtualHandler(target, handler));
console.log(proxy.password); // ****
}
FAQs
More permisive proxy objects by separating invariant bookkeeping from the target object.
We found that virtual-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.