Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
This uses the native async/await support in Node 7.x and newer to let you await
promises in the repl ("read-eval-print-loop" -- the interactive Node command line).
npm install -g async-repl
$ async-repl
async> 1 + 2
3
async> 1 + await new Promise(r => setTimeout(() => r(2), 1000))
3
async> let x = 1 + await new Promise(r => setTimeout(() => r(2), 1000))
undefined
async> x
3
async>
const repl = require('repl');
const stubber = require('async-repl/stubber');
const replInstance = repl.start({ prompt: 'my-fancy-repl> ' });
stubber(replInstance);
This tool doesn't support multi-line input.
Top-level object destructuring assignment like:
let { x } = await someThing()
doesn't currently work due to a bug in recast
(see test suite), but you can workaround like:
({x} = await someThing())
We necessarily resolve the top-level expression promise for you, so if you don't want to wait for resolution you should make sure you're not returning the promise as an expression.
# This will not block because it's a statement
let myPromise = makePromise()
# This will block because it's an expression
otherPromise = makePromise()
# This will block because now we're using the promise value as an expression
myPromise
const
variables in the repl scope can be overridden
async> const a = 1
undefined
async> a = 2
2
FAQs
Node repl that supports "await".
The npm package async-repl receives a total of 243 weekly downloads. As such, async-repl popularity was classified as not popular.
We found that async-repl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.