
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
babel-plugin-extend-scope-chain
Advanced tools
[](https://www.npmjs.org/package/babel-plugin-extend-scope-chain) [ { /* your script */ }
.
foo
assignment expressionInput:
foo = "bar";
Output:
window.foo = "bar";
foo.bar
assignment expressionInput:
foo.bar = "bar";
Output:
window.foo.bar = "bar";
Input:
var foo = "bar";
Output:
window.foo = "bar";
To bundle external scripts.
A specific use case for which this was developed is to bundle external supply-side platform (SSP) scripts into the main script. This enables us to decrease the amount of HTTP requests that are required to start header bidding.
The problem is that all vendor scripts assume that the script is loaded asynchronously, using script tags, e.g.
const scriptElement = document.createElement('script');
scriptElement.async = true;
scriptElement.src = '//script.js';
document.head.appendChild(scriptElement);
This assumption allows them to write code such as:
var foo = foo || 'bar';
In the above example, if foo
is not set, window.foo
becomes {}
.
We want to bundle and delay these script execution, i.e.
function loadVendorFoo () {
var foo = foo || 'bar';
}
The above code breaks, because now foo
is isolated to loadVendorFoo
scope, i.e. in the above code foo
will always equal "bar".
Using this transpiler, we namespace all global variable declarations using window
object, i.e. our script becomes:
function loadVendorFoo () {
var foo = window.foo = window.foo || 'bar';
}
Name | Type | Description | Default |
---|---|---|---|
globals | Array<string> | Names of global variables that must not be namespaced. | ['window'] |
export | boolean | Wraps the script body in a function and exports the function using module.exports . | false |
FAQs
[](https://www.npmjs.org/package/babel-plugin-extend-scope-chain) [![Travis build status](http://img.shields.io/travis/gajus/babel-plugin-extend-scope-chain/m
We found that babel-plugin-extend-scope-chain 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.